summaryrefslogtreecommitdiff
path: root/libc/inet
diff options
context:
space:
mode:
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) {