about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-06-22 05:58:14 +0000
committerUlrich Drepper <drepper@redhat.com>2002-06-22 05:58:14 +0000
commit05ae4d6ad95c139aacbc16ed6b50a24678d01bf8 (patch)
tree1f1177f5fc84f9bd51c7966e1e3e36a044b3843b /sysdeps
parentbff334e09023c8cf6327e9ff87b117f2331330d2 (diff)
downloadglibc-05ae4d6ad95c139aacbc16ed6b50a24678d01bf8.tar.gz
glibc-05ae4d6ad95c139aacbc16ed6b50a24678d01bf8.tar.xz
glibc-05ae4d6ad95c139aacbc16ed6b50a24678d01bf8.zip
Update.
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.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/unix/sysv/linux/getdents.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/getdents.c b/sysdeps/unix/sysv/linux/getdents.c
index 5d79a3a4d0..6dc9d714b5 100644
--- a/sysdeps/unix/sysv/linux/getdents.c
+++ b/sysdeps/unix/sysv/linux/getdents.c
@@ -1,4 +1,4 @@
-/* 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
@@ -129,6 +129,10 @@ __GETDENTS (int fd, char *buf, size_t nbytes)
 	  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)