summaryrefslogtreecommitdiff
path: root/libc/inet
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-04-06 20:28:45 +0000
committerEric Andersen <andersen@codepoet.org>2001-04-06 20:28:45 +0000
commit6278781655261a5011376b2fa2600996e32ca889 (patch)
tree11783e71b36c8c546c4dc02dff355b0f2478978b /libc/inet
parenta704ccaa5232184844cd67315951b39f85a6ba04 (diff)
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
Diffstat (limited to 'libc/inet')
-rw-r--r--libc/inet/hostid.c2
-rw-r--r--libc/inet/rpc/bindresvport.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/libc/inet/hostid.c b/libc/inet/hostid.c
index 84a441acf..0873aa4fc 100644
--- a/libc/inet/hostid.c
+++ b/libc/inet/hostid.c
@@ -17,7 +17,7 @@ int sethostid(long int new_id)
int fd;
int ret;
- if (geteuid() || getuid()) return errno=EPERM;
+ if (geteuid() || getuid()) return __set_errno(EPERM);
if ((fd=open(HOSTID,O_CREAT|O_WRONLY,0644))<0) return -1;
ret = write(fd,(void *)&new_id,sizeof(new_id)) == sizeof(new_id)
? 0 : -1;
diff --git a/libc/inet/rpc/bindresvport.c b/libc/inet/rpc/bindresvport.c
index ad8678416..e71dff7f4 100644
--- a/libc/inet/rpc/bindresvport.c
+++ b/libc/inet/rpc/bindresvport.c
@@ -62,14 +62,14 @@ struct sockaddr_in *sin;
bzero(sin, sizeof(*sin));
sin->sin_family = AF_INET;
} else if (sin->sin_family != AF_INET) {
- errno = EPFNOSUPPORT;
+ __set_errno(EPFNOSUPPORT);
return (-1);
}
if (port == 0) {
port = (getpid() % NPORTS) + STARTPORT;
}
res = -1;
- errno = EADDRINUSE;
+ __set_errno(EADDRINUSE);
for (i = 0; i < NPORTS && res < 0 && errno == EADDRINUSE; i++) {
sin->sin_port = htons(port++);
if (port > ENDPORT) {