diff options
author | Eric Andersen <andersen@codepoet.org> | 2003-12-31 12:13:27 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2003-12-31 12:13:27 +0000 |
commit | a16c1a5417211acf5b15d44588a62c40510d58a6 (patch) | |
tree | 9a9de7d515c321c23bdaed411ad5f8a01f6f15d7 /libc | |
parent | 7c3eb1f4a09caba155e3364ff32cd81a2312eb45 (diff) | |
download | uClibc-alpine-a16c1a5417211acf5b15d44588a62c40510d58a6.tar.bz2 uClibc-alpine-a16c1a5417211acf5b15d44588a62c40510d58a6.tar.xz |
Fir errno return when the file/path is NULL or points to an empty string.
-Erik
Diffstat (limited to 'libc')
-rw-r--r-- | libc/sysdeps/linux/common/syscalls.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libc/sysdeps/linux/common/syscalls.c b/libc/sysdeps/linux/common/syscalls.c index 1ef7c38b6..927228933 100644 --- a/libc/sysdeps/linux/common/syscalls.c +++ b/libc/sysdeps/linux/common/syscalls.c @@ -89,7 +89,7 @@ int __libc_open (const char * file, int flags, ...) { mode_t mode; if (unlikely(file==NULL || *file=='\0')) { - __set_errno(EINVAL); + __set_errno(ENOENT); return -1; } if (unlikely(((strlen(file)+1) > NAME_MAX))) { @@ -150,7 +150,7 @@ _syscall3(int, __syscall_execve, const char *, filename, int execve(const char *filename, char *const *argv, char *const *envp) { if (unlikely(filename==NULL || *filename=='\0')) { - __set_errno(EINVAL); + __set_errno(ENOENT); return -1; } if (unlikely(((strlen(filename)+1) > NAME_MAX))) { @@ -171,7 +171,7 @@ _syscall1(int, __syscall_chdir, const char *, path); int chdir(const char *path) { if (unlikely(path==NULL || *path=='\0')) { - __set_errno(EINVAL); + __set_errno(ENOENT); return -1; } if (unlikely(((strlen(path)+1) > NAME_MAX))) { @@ -514,7 +514,7 @@ int rename(const char *oldpath, const char *newpath) if (unlikely((oldpath==NULL || newpath==NULL || *oldpath=='\0' || *newpath=='\0'))) { - __set_errno(EINVAL); + __set_errno(ENOENT); return -1; } if (unlikely(((strlen(oldpath)+1) >= NAME_MAX) || @@ -746,7 +746,7 @@ _syscall1(int, __syscall_chroot, const char *, path); int chroot(const char *path) { if (unlikely(path==NULL || *path=='\0')) { - __set_errno(EINVAL); + __set_errno(ENOENT); return -1; } if (unlikely(((strlen(path)+1) > NAME_MAX))) { @@ -1179,7 +1179,7 @@ _syscall2(int, __syscall_statfs, const char *, path, struct statfs *, buf); int statfs(const char *path, struct statfs *buf) { if (unlikely(path==NULL || *path=='\0')) { - __set_errno(EINVAL); + __set_errno(ENOENT); return -1; } if (unlikely(((strlen(path)+1) > NAME_MAX))) { |