Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: fix select polling in ztcp and zsocket
- X-seq: zsh-workers 35839
- From: Joshua Krusell <js.shirin@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH: fix select polling in ztcp and zsocket
- Date: Mon, 20 Jul 2015 15:14:43 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=SL4j/a9zjKf9nfuW9X6beFVxASpDlm9mv6RMtp9egMA=; b=YsU7wpYr8eCnHbEeAqU43WyKHPr2v70Y4WmkVJTaf9zKPAUvPr2vNjtjwvq9Lc3yt8 SiHnYT3J802BNK0J7LlumPsU3AWgWMwN5M3kTThoQ1KqGy/DIAtH34WzGt6yLHU89+qD Bsz1XSKDh4XKL8Vh3cyseeicFO1rJlmWCZRuKL0015/M+bvD6cTFC4HSOOCVuCUP8XZ/ 8+Jh5czksnXcy+2v4idfWfxwEopzEsQv0sEey/cD2CkGobkKQAVDZt/kbnG9YkfsvzXm ZSld/7bKMFEL84t5aqc4Z4l1gh/GEnWn+fyrzVOjtcs6bdu8OlVmyii56Iwk9lpxojKm UswQ==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
ztcp -t and zsocket -t are broken on systems using select()
/jsks
diff --git a/Src/Modules/socket.c b/Src/Modules/socket.c
index 6c70d31..cd56d46 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 0d95220..d5b62a8 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);
Messages sorted by:
Reverse Date,
Date,
Thread,
Author