+2002-06-21 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/unix/sysv/linux/getdents.c [__ASSUME_GETDENTS64_SYSCALL]
+ (__GETDENTS): Check for failed getdents64 syscall.
+ * dirent/Makefile (tests): Add bug-readdir1.
+ * dirent/bug-readdir1.c: New file.
+
2002-06-17 Jakub Jelinek <jakub@redhat.com>
* elf/dl-lookup.c (_dl_debug_bindings): Use type_class 4 for TLS
-# Copyright (C) 1991,92,93,94,95,96,97,98,99,2000 Free Software Foundation, Inc.
+# Copyright (C) 1991-2000, 2002 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
alphasort64 versionsort64
distribute := dirstream.h
-tests := list tst-seekdir opendir-tst1
+tests := list tst-seekdir opendir-tst1 bug-readdir1
include ../Rules
--- /dev/null
+#include <dirent.h>
+#include <errno.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+
+
+int
+main (void)
+{
+ DIR *dirp;
+ struct dirent* ent;
+
+ /* open a dir stream */
+ dirp = opendir ("/tmp");
+ if (dirp == NULL)
+ {
+ if (errno == ENOENT)
+ exit (0);
+
+ perror ("opendir");
+ exit (1);
+ }
+
+ /* close the dir stream, making it invalid */
+ if (closedir (dirp))
+ {
+ perror ("closedir");
+ exit (1);
+ }
+
+ ent = readdir (dirp);
+
+ return ent != NULL || errno != EBADF;
+}
-/* Copyright (C) 1993,95,96,97,98,99,2000,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995-2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
const size_t size_diff = (offsetof (struct kernel_dirent64, d_name)
- offsetof (DIRENT_TYPE, d_name));
+ /* Return the error if encountered. */
+ if (retval == -1)
+ return -1;
+
/* If the structure returned by the kernel is identical to what we
need, don't do any conversions. */
if (offsetof (DIRENT_TYPE, d_name)