Browse Source

access(2) should return -1 on error

K. Lange 1 year ago
parent
commit
56d412fd31
1 changed files with 1 additions and 0 deletions
  1. 1 0
      libc/unistd/access.c

+ 1 - 0
libc/unistd/access.c

@@ -9,6 +9,7 @@ int access(const char *pathname, int mode) {
 	int result = syscall_access((char *)pathname, mode);
 	if (result < 0) {
 		errno = ENOENT; /* XXX */
+		return -1;
 	}
 	return result;
 }