Commit cbdb3cf9 authored by Peter Stephenson's avatar Peter Stephenson

not quite posted: check for error return before EINTR

parent 9728f535
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment