summaryrefslogtreecommitdiff
path: root/Src/Modules/tcp.c
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2015-08-22 01:55:58 +0200
committerAxel Beckert <abe@deuxchevaux.org>2015-08-22 01:55:58 +0200
commit02f6e25bfcd5feb9a093377dda0dd549cdf5c309 (patch)
tree9a25e61122b3fa0d0a1ff68b5ef05c775ff78b1e /Src/Modules/tcp.c
parente04a19735ffc8523b93b33074f685ad4e2c92e0c (diff)
parent881474edcb223ac22a08d81a824809c33ca3a9c9 (diff)
downloadzsh-02f6e25bfcd5feb9a093377dda0dd549cdf5c309.tar.gz
zsh-02f6e25bfcd5feb9a093377dda0dd549cdf5c309.zip
Merge tag 'zsh-5.0.8-test-2' into debian
Diffstat (limited to 'Src/Modules/tcp.c')
-rw-r--r--Src/Modules/tcp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/Src/Modules/tcp.c b/Src/Modules/tcp.c
index 0d9522047..bc1765da1 100644
--- a/Src/Modules/tcp.c
+++ b/Src/Modules/tcp.c
@@ -519,7 +519,7 @@ bin_ztcp(char *nam, char **args, Options ops, UNUSED(int func))
tv.tv_sec = 0;
tv.tv_usec = 0;
- if ((ret = select(lfd+1, &rfds, NULL, NULL, &tv))) return 1;
+ if ((ret = select(lfd+1, &rfds, NULL, NULL, &tv)) == 0) return 1;
else if (ret == -1)
{
zwarnnam(nam, "select error: %e", errno);
@@ -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 (rfd < 0 && errno == EINTR && !errflag);
+
+ if (rfd == -1) {
zwarnnam(nam, "could not accept connection: %e", errno);
tcp_close(sess);
return 1;