From 855ceea901c2cd5324ec3f427fa4303ac55fa51d Mon Sep 17 00:00:00 2001 From: Joshua Krusell Date: Wed, 22 Jul 2015 13:06:56 -0700 Subject: 35939: fix select polling in ztcp and zsocket --- ChangeLog | 4 ++++ Src/Modules/socket.c | 2 +- Src/Modules/tcp.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b09a021f2..8083590b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2015-07-22 Barton E. Schaefer + * 35939: Joshua Krusell : + Src/Modules/socket.c, Src/Modules/tcp.c: fix select polling in + ztcp and zsocket + * unposted: Completion/Zsh/Type/_directory_stack: move some more recent code so an old comment is connected to the correct bit of older code diff --git a/Src/Modules/socket.c b/Src/Modules/socket.c index 6c70d3166..cd56d4646 100644 --- a/Src/Modules/socket.c +++ b/Src/Modules/socket.c @@ -175,7 +175,7 @@ bin_zsocket(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); diff --git a/Src/Modules/tcp.c b/Src/Modules/tcp.c index 0d9522047..d5b62a82e 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); -- cgit v1.2.3-70-g09d2