Browse Source

libc: opendir should not set errno, it's set by open

K. Lange 2 years ago
parent
commit
0095f8a2ee
1 changed files with 1 additions and 1 deletions
  1. 1 1
      libc/dirent/dir.c

+ 1 - 1
libc/dirent/dir.c

@@ -11,7 +11,7 @@ DEFN_SYSCALL3(readdir, SYS_READDIR, int, int, void *);
 DIR * opendir (const char * dirname) {
 	int fd = open(dirname, O_RDONLY);
 	if (fd < 0) {
-		errno = -fd;
+		/* errno was set by open */
 		return NULL;
 	}