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

This commit is contained in:
K. Lange 2019-01-03 20:21:32 +09:00
parent 8680381ecc
commit 0095f8a2ee
1 changed files with 1 additions and 1 deletions

View File

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