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.
This commit is contained in:
Benjamin Riefenstahl 2022-06-10 16:02:13 +00:00 committed by Ori Bernstein
parent 0ec0154bc9
commit 9fc38d43d4

View file

@ -56,10 +56,7 @@ bind(int fd, void *a, int alen)
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!!! */