about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <schaefer@zsh.org>2023-11-15 20:29:50 -0800
committerBart Schaefer <schaefer@zsh.org>2023-11-15 20:29:50 -0800
commitddfc81a2b81e19c13f60bfff30f28ed520df8f57 (patch)
tree71f88875e6c8706598e7f65ac58ca4d73f558a6e
parent0840f34e1fb38df43b69bc5f189babfc938e3c63 (diff)
downloadzsh-ddfc81a2b81e19c13f60bfff30f28ed520df8f57.tar.gz
zsh-ddfc81a2b81e19c13f60bfff30f28ed520df8f57.tar.xz
zsh-ddfc81a2b81e19c13f60bfff30f28ed520df8f57.zip
52309: fix cases that hang with all signals blocked.
* no job control inside <<(substition)
* allow interrupt of multios reading from a terminal
-rw-r--r--ChangeLog4
-rw-r--r--Src/exec.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 10631b9e3..0de5c2fcb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2023-11-15  Bart Schaefer  <schaefer@zsh.org>
 
+	* 52309: Src/exec.c: suppress job control inside <<(substition)
+	to fix cases that hang with all signals blocked.  Similarly,
+	allow interrupt of multios reading from a terminal.
+
 	* 52308: Etc/FAQ.yo: mention new features, fix some old answers
 
 	* 52275: Src/compat.c: rationality in zgetdir() and zgetcwd() to
diff --git a/Src/exec.c b/Src/exec.c
index 285d2c5ad..97823760f 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -2309,7 +2309,7 @@ closemn(struct multio **mfds, int fd, int type)
 	    for (i = 0; i < mn->ct; i++)
 		while ((len = read(mn->fds[i], buf, TCBUFSIZE)) != 0) {
 		    if (len < 0) {
-			if (errno == EINTR)
+			if (errno == EINTR && !isatty(mn->fds[i]))
 			    continue;
 			else
 			    break;
@@ -5096,7 +5096,7 @@ getpipe(char *cmd, int nullexec)
 	procsubstpid = pid;
 	return pipes[!out];
     }
-    entersubsh(ESUB_ASYNC|ESUB_PGRP, NULL);
+    entersubsh(ESUB_ASYNC|ESUB_PGRP|ESUB_NOMONITOR, NULL);
     redup(pipes[out], out);
     closem(FDT_UNUSED, 0);	/* this closes pipes[!out] as well */
     cmdpush(CS_CMDSUBST);