summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common')
-rw-r--r--libc/sysdeps/linux/common/create_module.c2
-rw-r--r--libc/sysdeps/linux/common/errno.c1
-rw-r--r--libc/sysdeps/linux/common/getdnnm.c4
-rw-r--r--libc/sysdeps/linux/common/gethstnm.c4
-rw-r--r--libc/sysdeps/linux/common/seteuid.c2
-rw-r--r--libc/sysdeps/linux/common/syscalls.c2
6 files changed, 8 insertions, 7 deletions
diff --git a/libc/sysdeps/linux/common/create_module.c b/libc/sysdeps/linux/common/create_module.c
index 1cacaefaf..223b909f5 100644
--- a/libc/sysdeps/linux/common/create_module.c
+++ b/libc/sysdeps/linux/common/create_module.c
@@ -42,7 +42,7 @@ unsigned long create_module(const char *name, size_t size)
/* Jump through hoops to fixup error return codes */
if (ret == -1 && errno > 125) {
ret = -errno;
- errno = 0;
+ __set_errno(0);
}
return ret;
}
diff --git a/libc/sysdeps/linux/common/errno.c b/libc/sysdeps/linux/common/errno.c
index 418fc933b..e6a8ae875 100644
--- a/libc/sysdeps/linux/common/errno.c
+++ b/libc/sysdeps/linux/common/errno.c
@@ -6,3 +6,4 @@ int * __errno_location ( void )
{
return &errno;
}
+
diff --git a/libc/sysdeps/linux/common/getdnnm.c b/libc/sysdeps/linux/common/getdnnm.c
index fdcbb0f3a..46751b1e7 100644
--- a/libc/sysdeps/linux/common/getdnnm.c
+++ b/libc/sysdeps/linux/common/getdnnm.c
@@ -9,14 +9,14 @@ getdomainname(char *name, size_t len)
struct utsname uts;
if (name == NULL) {
- errno = EINVAL;
+ __set_errno(EINVAL);
return -1;
}
if (uname(&uts) == -1) return -1;
if (strlen(uts.domainname)+1 > len) {
- errno = EINVAL;
+ __set_errno(EINVAL);
return -1;
}
strcpy(name, uts.domainname);
diff --git a/libc/sysdeps/linux/common/gethstnm.c b/libc/sysdeps/linux/common/gethstnm.c
index 0728f65a4..0f7a04681 100644
--- a/libc/sysdeps/linux/common/gethstnm.c
+++ b/libc/sysdeps/linux/common/gethstnm.c
@@ -9,14 +9,14 @@ gethostname(char *name, size_t len)
struct utsname uts;
if (name == NULL) {
- errno = EINVAL;
+ __set_errno(EINVAL);
return -1;
}
if (uname(&uts) == -1) return -1;
if (strlen(uts.nodename)+1 > len) {
- errno = EINVAL;
+ __set_errno(EINVAL);
return -1;
}
strcpy(name, uts.nodename);
diff --git a/libc/sysdeps/linux/common/seteuid.c b/libc/sysdeps/linux/common/seteuid.c
index 179477a14..a0a63610d 100644
--- a/libc/sysdeps/linux/common/seteuid.c
+++ b/libc/sysdeps/linux/common/seteuid.c
@@ -9,7 +9,7 @@ int seteuid(uid_t uid)
case 2:
if (uid == 65535)
{
- errno = EINVAL;
+ __set_errno(EINVAL);
return -1;
}
break;
diff --git a/libc/sysdeps/linux/common/syscalls.c b/libc/sysdeps/linux/common/syscalls.c
index ca0b3a317..8d51f1f4f 100644
--- a/libc/sysdeps/linux/common/syscalls.c
+++ b/libc/sysdeps/linux/common/syscalls.c
@@ -139,7 +139,7 @@ int _xmknod (int version, const char * path, mode_t mode, dev_t *dev)
case 1:
return mknod (path, mode, *dev);
default:
- errno = EINVAL;
+ __set_errno(EINVAL);
return -1;
}
}