projects
/
kopensolaris-gnu
/
glibc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2277f34
)
(bindresvport): Break loop when successful.
author
drepper
<drepper>
Mon, 23 May 2005 17:46:47 +0000
(17:46 +0000)
committer
drepper
<drepper>
Mon, 23 May 2005 17:46:47 +0000
(17:46 +0000)
sunrpc/bindrsvprt.c
patch
|
blob
|
history
diff --git
a/sunrpc/bindrsvprt.c
b/sunrpc/bindrsvprt.c
index
671f229
..
2cd40a0
100644
(file)
--- a/
sunrpc/bindrsvprt.c
+++ b/
sunrpc/bindrsvprt.c
@@
-75,7
+75,7
@@
bindresvport (int sd, struct sockaddr_in *sin)
int nports = ENDPORT - startport + 1;
again:
- for (i = 0; i < nports
&& res < 0 && errno == EADDRINUSE
; ++i)
+ for (i = 0; i < nports; ++i)
{
sin->sin_port = htons (port++);
if (port > ENDPORT)
@@
-83,6
+83,8
@@
bindresvport (int sd, struct sockaddr_in *sin)
port = startport;
}
res = __bind (sd, sin, sizeof (struct sockaddr_in));
+ if (res >= 0 || errno != EADDRINUSE)
+ break;
}
if (i == nports && startport != LOWPORT)