summaryrefslogtreecommitdiff
path: root/lib/libc/net/rcmd.c
diff options
context:
space:
mode:
authorYoshinobu Inoue <shin@FreeBSD.org>2000-02-10 19:46:47 +0000
committerYoshinobu Inoue <shin@FreeBSD.org>2000-02-10 19:46:47 +0000
commit474ce1d1906e6907b28b311e0cc4aa36ad7f2def (patch)
treec68774275d9decd599aba09dd9b20e559ed058c7 /lib/libc/net/rcmd.c
parentb322cef8a11dab9dfe20e7c235f772b70b5b5dce (diff)
Notes
Diffstat (limited to 'lib/libc/net/rcmd.c')
-rw-r--r--lib/libc/net/rcmd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libc/net/rcmd.c b/lib/libc/net/rcmd.c
index 63ea58f7add5..5bbef4bb4a85 100644
--- a/lib/libc/net/rcmd.c
+++ b/lib/libc/net/rcmd.c
@@ -127,14 +127,18 @@ rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af)
for (timo = 1, lport = IPPORT_RESERVED - 1;;) {
s = rresvport_af(&lport, ai->ai_family);
if (s < 0) {
+ if (errno != EAGAIN && ai->ai_next) {
+ ai = ai->ai_next;
+ continue;
+ }
if (errno == EAGAIN)
(void)fprintf(stderr,
"rcmd: socket: All ports in use\n");
else
(void)fprintf(stderr, "rcmd: socket: %s\n",
strerror(errno));
- sigsetmask(oldmask);
freeaddrinfo(res);
+ sigsetmask(oldmask);
return (-1);
}
_fcntl(s, F_SETOWN, pid);