From: Andreas Fuchs Date: Tue, 20 Jul 2004 20:22:28 +0000 (+0000) Subject: 0.8.12.45: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=c931816dd67353b58e7491a4dee52eaceb4a945e;p=sbcl.git 0.8.12.45: Fix sb-posix:readdir for the new sb-grovel types * readdir now returns a (* dirent), as reflected by reality * Add test cases for readdir and opendir, too --- diff --git a/contrib/sb-posix/interface.lisp b/contrib/sb-posix/interface.lisp index 1e78322..1f03272 100644 --- a/contrib/sb-posix/interface.lisp +++ b/contrib/sb-posix/interface.lisp @@ -128,7 +128,7 @@ (fcntl-without-arg fd cmd))) (define-call "opendir" (* t) null-alien (pathname filename)) -(define-call "readdir" sb-posix::dirent +(define-call "readdir" (* sb-posix::dirent) ;; readdir() has the worst error convention in the world. It's just ;; too painful to support. (return is NULL _and_ errno "unchanged" ;; is not an error, it's EOF). diff --git a/contrib/sb-posix/posix-tests.lisp b/contrib/sb-posix/posix-tests.lisp index baadf8c..69fee84 100644 --- a/contrib/sb-posix/posix-tests.lisp +++ b/contrib/sb-posix/posix-tests.lisp @@ -359,3 +359,21 @@ (let ((fd (sb-posix:open "/dev/null" sb-posix::o-nonblock))) (= (sb-posix:fcntl fd sb-posix::f-getfl) sb-posix::o-nonblock)) t) + + +(deftest opendir.1 + (let ((dir (sb-posix:opendir "/"))) + (sb-alien:null-alien dir)) + nil) + +(deftest readdir.1 + (let ((dir (sb-posix:opendir "/"))) + (unwind-protect + (block dir-loop + (loop for dirent = (sb-posix:readdir dir) + until (sb-alien:null-alien dirent) + when (not (stringp (sb-posix:dirent-name dirent))) + do (return-from dir-loop nil) + finally (return t))) + (sb-posix:closedir dir))) + t) diff --git a/version.lisp-expr b/version.lisp-expr index eb2f8c4..4df2176 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.8.12.44" +"0.8.12.45"