[uClibc-cvs] uClibc/libc/sysdeps/linux/common syscalls.c, 1.123, 1.124

Erik Andersen andersen at uclibc.org
Wed Dec 31 12:13:29 UTC 2003


Update of /var/cvs/uClibc/libc/sysdeps/linux/common
In directory nail:/tmp/cvs-serv15175

Modified Files:
	syscalls.c 
Log Message:
Fir errno return when the file/path is NULL or points to an empty string.
 -Erik


Index: syscalls.c
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/common/syscalls.c,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -d -r1.123 -r1.124
--- syscalls.c	31 Dec 2003 11:50:08 -0000	1.123
+++ syscalls.c	31 Dec 2003 12:13:27 -0000	1.124
@@ -89,7 +89,7 @@
 {
 	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 @@
 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 @@
 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 @@
 	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 @@
 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 @@
 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))) {




More information about the uClibc-cvs mailing list