git: 9front

Download patch

ref: 549b5c51465321635ea3f59f870de689b2a3fc59
parent: 9a1399bc21fd7ed0a78438af3c4d3108433fee38
author: Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
date: Fri Jun 10 12:02:13 EDT 2022

ape/bsd/bind.c: Do not issue "bind *".

Despite the documentation, "bind *" is invalid and gives the error
"bad numeric port" in devip.c:setladdrport.

"bind 0" OTOH is actually supported fine in the Plan9 API and has the
right sematics.

--- a/sys/src/ape/lib/bsd/bind.c
+++ b/sys/src/ape/lib/bsd/bind.c
@@ -56,10 +56,7 @@
 		return -1;
 	}
 	port = _sock_inport(&r->addr);
-	if(port > 0)
-		snprintf(msg, sizeof msg, "bind %d", port);
-	else
-		strcpy(msg, "bind *");
+	snprintf(msg, sizeof msg, "bind %d", port);
 	n = write(cfd, msg, strlen(msg));
 	if(n < 0){
 		errno = EOPNOTSUPP;	/* Improve error reporting!!! */
--