]> granicus.if.org Git - php/commitdiff
Fix readdir bug in libc5
authorStanislav Malyshev <stas@php.net>
Thu, 7 Sep 2000 17:55:53 +0000 (17:55 +0000)
committerStanislav Malyshev <stas@php.net>
Thu, 7 Sep 2000 17:55:53 +0000 (17:55 +0000)
@Fix readdir bug in libc5
# If libc5 receives 0 in *result of readdir_r, it just returns error
# That's a clear bug, so this is a workaround.

ext/standard/dir.c

index dc949c1b48388a0703c1ab85967f548b819ebbc4..eeebfa5c008464d638c935b130e7865e01957793 100644 (file)
@@ -290,7 +290,7 @@ PHP_FUNCTION(readdir)
        pval **id, **tmp, *myself;
        php_dir *dirp;
        char entry[sizeof(struct dirent)+MAXPATHLEN+1];
-       struct dirent *result;
+       struct dirent *result = (struct dirent *)&entry; /* patch for libc5 readdir problems */
        DIRLS_FETCH();
 
        FETCH_DIRP();