ape/bsd/bind.c, ape/bsd/listen.c: Use _syserrno.

This commit is contained in:
Benjamin Riefenstahl 2022-07-06 03:46:07 +00:00 committed by Ori Bernstein
parent e01e80c5e7
commit e402fd8340
2 changed files with 6 additions and 2 deletions

View file

@ -61,7 +61,9 @@ bind(int fd, void *a, int alen)
n = write(cfd, msg, strlen(msg));
if(n < 0){
errno = EOPNOTSUPP; /* Improve error reporting!!! */
_syserrno();
if(errno == EPLAN9)
errno = EOPNOTSUPP;
close(cfd);
return -1;
}

View file

@ -143,7 +143,9 @@ listen(fd, backlog)
_sock_inaddr2string(r, msg + 9, sizeof msg - 9);
n = write(cfd, msg, strlen(msg));
if(n < 0){
errno = EOPNOTSUPP; /* Improve error reporting!!! */
_syserrno();
if(errno == EPLAN9)
errno = EOPNOTSUPP;
close(cfd);
return -1;
}