Commit 9728f535 authored by Joshua Krusell's avatar Joshua Krusell Committed by Peter Stephenson

36039: Restart socket commands on EINTR

parent ade35d3c
2015-08-10 Peter Stephenson <p.stephenson@samsung.com>
* Joshua Krusell: 36039: Src/Modules/socket.c,
Src/Modules/tcp.c: Restart socket commands on EINTR.
* 35885: Doc/Zsh/mod_system.zo: document how to close
fd's opened with sysopen.
......
......@@ -191,8 +191,11 @@ bin_zsocket(char *nam, char **args, Options ops, UNUSED(int func))
}
len = sizeof(soun);
if ((rfd = accept(lfd, (struct sockaddr *)&soun, &len)) == -1)
{
do {
rfd = accept(lfd, (struct sockaddr *)&soun, &len);
} while (errno == EINTR && !errflag);
if (rfd == -1) {
zwarnnam(nam, "could not accept connection: %e", errno);
return 1;
}
......
......@@ -536,8 +536,11 @@ bin_ztcp(char *nam, char **args, Options ops, UNUSED(int func))
sess = zts_alloc(ZTCP_INBOUND);
len = sizeof(sess->peer.in);
if ((rfd = accept(lfd, (struct sockaddr *)&sess->peer.in, &len)) == -1)
{
do {
rfd = accept(lfd, (struct sockaddr *)&sess->peer.in, &len);
} while (errno == EINTR && !errflag);
if (rfd == -1) {
zwarnnam(nam, "could not accept connection: %e", errno);
tcp_close(sess);
return 1;
......
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