Tue Mar 19 14:18:42 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
authorroland <roland>
Mon, 25 Mar 1996 17:47:08 +0000 (17:47 +0000)
committerroland <roland>
Mon, 25 Mar 1996 17:47:08 +0000 (17:47 +0000)
* sysdeps/unix/readdir.c: Test [! _DIRENT_HAVE_D_RECLEN] instead of
(sizeof (DP->d_name) > 1) to detect fixed-size dir entries.

sysdeps/unix/readdir.c

index 84ac033..00446a2 100644 (file)
@@ -52,11 +52,12 @@ readdir (DIR *dirp)
          off_t base;
          ssize_t bytes;
 
-         if (sizeof (dp->d_name) > 1)
-           /* Fixed-size struct; must read one at a time (see below).  */
-           maxread = sizeof *dp;
-         else
-           maxread = dirp->allocation;
+#ifndef _DIRENT_HAVE_D_RECLEN
+         /* Fixed-size struct; must read one at a time (see below).  */
+         maxread = sizeof *dp;
+#else
+         maxread = dirp->allocation;
+#endif
 
          base = dirp->filepos;
          bytes = __getdirentries (dirp->fd, dirp->data, maxread, &base);