diff --git a/sys/src/ape/lib/bsd/bind.c b/sys/src/ape/lib/bsd/bind.c index aa4762c0b..a80a62b64 100644 --- a/sys/src/ape/lib/bsd/bind.c +++ b/sys/src/ape/lib/bsd/bind.c @@ -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; } diff --git a/sys/src/ape/lib/bsd/listen.c b/sys/src/ape/lib/bsd/listen.c index 0b6c14c8d..9ec547dfd 100644 --- a/sys/src/ape/lib/bsd/listen.c +++ b/sys/src/ape/lib/bsd/listen.c @@ -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; }