about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoshua Krusell <js.shirin@gmail.com>2015-07-22 13:06:56 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2015-07-22 13:06:56 -0700
commit855ceea901c2cd5324ec3f427fa4303ac55fa51d (patch)
tree81962051059f57643dfcf6dd22920d72f1d10751
parent30dd372bcb854dd4d1374d5fd3f7c4604ade0861 (diff)
downloadzsh-855ceea901c2cd5324ec3f427fa4303ac55fa51d.tar.gz
zsh-855ceea901c2cd5324ec3f427fa4303ac55fa51d.tar.xz
zsh-855ceea901c2cd5324ec3f427fa4303ac55fa51d.zip
35939: fix select polling in ztcp and zsocket
-rw-r--r--ChangeLog4
-rw-r--r--Src/Modules/socket.c2
-rw-r--r--Src/Modules/tcp.c2
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  <schaefer@zsh.org>
 
+	* 35939: Joshua Krusell <js.shirin@gmail.com>:
+	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);