projects
/
external
/
glibc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4ceae91
)
* sysdeps/unix/readdir.c: Make sure we don't modify errno when we reached EOF.
author
Andreas Schwab
<schwab@suse.de>
Wed, 9 May 2001 16:36:11 +0000
(16:36 +0000)
committer
Andreas Schwab
<schwab@suse.de>
Wed, 9 May 2001 16:36:11 +0000
(16:36 +0000)
sysdeps/unix/readdir.c
patch
|
blob
|
history
diff --git
a/sysdeps/unix/readdir.c
b/sysdeps/unix/readdir.c
index
4cb66ba
..
312660a
100644
(file)
--- a/
sysdeps/unix/readdir.c
+++ b/
sysdeps/unix/readdir.c
@@
-39,6
+39,7
@@
DIRENT_TYPE *
__READDIR (DIR *dirp)
{
DIRENT_TYPE *dp;
+ int saved_errno = errno;
__libc_lock_lock (dirp->lock);
@@
-63,6
+64,9
@@
__READDIR (DIR *dirp)
bytes = __GETDENTS (dirp->fd, dirp->data, maxread);
if (bytes <= 0)
{
+ /* Don't modifiy errno when reaching EOF. */
+ if (bytes == 0)
+ __set_errno (saved_errno);
dp = NULL;
break;
}