mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-01 05:16:05 +01:00
not quite posted: check for error return before EINTR
This commit is contained in:
parent
9728f535e2
commit
cbdb3cf9be
3 changed files with 5 additions and 2 deletions
|
@ -1,5 +1,8 @@
|
|||
2015-08-10 Peter Stephenson <p.stephenson@samsung.com>
|
||||
|
||||
* not quite posted: Src/Modules/socket.c, Src/Modules/tcp.c:
|
||||
check for error return before testing for EINTR.
|
||||
|
||||
* Joshua Krusell: 36039: Src/Modules/socket.c,
|
||||
Src/Modules/tcp.c: Restart socket commands on EINTR.
|
||||
|
||||
|
|
|
@ -193,7 +193,7 @@ bin_zsocket(char *nam, char **args, Options ops, UNUSED(int func))
|
|||
len = sizeof(soun);
|
||||
do {
|
||||
rfd = accept(lfd, (struct sockaddr *)&soun, &len);
|
||||
} while (errno == EINTR && !errflag);
|
||||
} while (rfd < 0 && errno == EINTR && !errflag);
|
||||
|
||||
if (rfd == -1) {
|
||||
zwarnnam(nam, "could not accept connection: %e", errno);
|
||||
|
|
|
@ -538,7 +538,7 @@ bin_ztcp(char *nam, char **args, Options ops, UNUSED(int func))
|
|||
len = sizeof(sess->peer.in);
|
||||
do {
|
||||
rfd = accept(lfd, (struct sockaddr *)&sess->peer.in, &len);
|
||||
} while (errno == EINTR && !errflag);
|
||||
} while (rfd < 0 && errno == EINTR && !errflag);
|
||||
|
||||
if (rfd == -1) {
|
||||
zwarnnam(nam, "could not accept connection: %e", errno);
|
||||
|
|
Loading…
Reference in a new issue