about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRoman Perepelitsa <roman.perepelitsa@gmail.com>2020-02-06 13:42:32 -0600
committerdana <dana@dana.is>2020-02-06 13:42:32 -0600
commit754fdc6580192e81ecc0628349102308868b4857 (patch)
treefbe8687766ca3b9d3ddf7b54242754aba71e2675
parent1f238665f6a4f9fce9232d305a95c58f13ed0c5a (diff)
downloadzsh-754fdc6580192e81ecc0628349102308868b4857.tar.gz
zsh-754fdc6580192e81ecc0628349102308868b4857.tar.xz
zsh-754fdc6580192e81ecc0628349102308868b4857.zip
zsh/system: Fix infinite loop in sysread
-rw-r--r--ChangeLog3
-rw-r--r--Src/Modules/system.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 0116724b1..5b9ed5271 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2020-02-06  dana  <dana@dana.is>
 
+	* Roman Perepelitsa: 45382: Src/Modules/system.c: Fix infinite
+	loop in sysread
+
 	* Martin von Wittich: 45388 (tweaked):
 	Completion/Unix/Type/_diff_options: Restore -w completion lost
 	in workers/43351
diff --git a/Src/Modules/system.c b/Src/Modules/system.c
index 50de59cf9..fb3d80773 100644
--- a/Src/Modules/system.c
+++ b/Src/Modules/system.c
@@ -174,7 +174,7 @@ bin_sysread(char *nam, char **args, Options ops, UNUSED(int func))
 	}
 
 	while ((ret = select(infd+1, (SELECT_ARG_2_T) &fds,
-			     NULL, NULL,&select_tv)) < 1) {
+			     NULL, NULL,&select_tv)) < 0) {
 	    if (errno != EINTR || errflag || retflag || breaks || contflag)
 		break;
 	}