(fdopendir): Don't change errno when returning non-NULL.

This commit is contained in:
Jim Meyering committed 2005-11-23 13:35:09 +00:00
1 parent 1000eb18b6
commit e8609798de
1 file changed
+1 -1
+1 -1
View File
@@ -232,7 +232,7 @@ fdopendir (int fd)
char *proc_file;
BUILD_PROC_NAME (proc_file, fd, ".");
dir = opendir (proc_file);
saved_errno = errno;
saved_errno = (dir == NULL ? errno : 0);
/* If the syscall succeeded, or if it failed with an unexpected
errno value, then return right away. Otherwise, fall through
and resort to using save_cwd/restore_cwd. */