From 6278781655261a5011376b2fa2600996e32ca889 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 6 Apr 2001 20:28:45 +0000 Subject: Fix include/errno.h to not use kernel header, and instead use bits/errno.h. This required we use _LIBC instead of __LIBC__ to be consistent with glibc. This had some sideffects in sys/syscalls.h. While fixing things, I made everything use __set_errno() for (eventual) thread support. -Erik --- libc/sysdeps/linux/common/create_module.c | 2 +- libc/sysdeps/linux/common/errno.c | 1 + libc/sysdeps/linux/common/getdnnm.c | 4 ++-- libc/sysdeps/linux/common/gethstnm.c | 4 ++-- libc/sysdeps/linux/common/seteuid.c | 2 +- libc/sysdeps/linux/common/syscalls.c | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) (limited to 'libc/sysdeps/linux/common') 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; } } -- cgit v1.2.3