shithub: plan9front

Download patch

ref: e402fd834015e36c307e8f84656e18b070d60f6b
parent: e01e80c5e7d4b619754686acec70c1fd24d5f623
author: Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
date: Tue Jul 5 23:46:07 EDT 2022

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

--- a/sys/src/ape/lib/bsd/bind.c	Tue Jul  5 23:38:17 2022
+++ b/sys/src/ape/lib/bsd/bind.c	Tue Jul  5 23:46:07 2022
@@ -61,7 +61,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;
 	}
--- a/sys/src/ape/lib/bsd/listen.c	Tue Jul  5 23:38:17 2022
+++ b/sys/src/ape/lib/bsd/listen.c	Tue Jul  5 23:46:07 2022
@@ -143,7 +143,9 @@
 		_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;
 		}