about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-07-12 15:09:56 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-07-12 15:09:56 +0000
commit3257f6b8d561cdf8805744d2a988b4bf414249fc (patch)
tree0fd39eb26cadc23d17368c91217067816745c331 /Src/exec.c
parent653d6a0dd95668eb3ad0d92de985cf14c1f65a8d (diff)
downloadzsh-3257f6b8d561cdf8805744d2a988b4bf414249fc.tar.gz
zsh-3257f6b8d561cdf8805744d2a988b4bf414249fc.tar.xz
zsh-3257f6b8d561cdf8805744d2a988b4bf414249fc.zip
27134: Close SHTTY on exec.
27135: POSIX_JOBS leaves MONITOR on in subshell and doesn't save
parent job table.
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/Src/exec.c b/Src/exec.c
index 004459abf..e68237948 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -595,6 +595,12 @@ execute(LinkList args, int flags, int defpath)
      * here, which should be visible to external processes.
      */
     closem(FDT_XTRACE);
+#ifndef FD_CLOEXEC
+    if (SHTTY != -1) {
+	close(SHTTY);
+	SHTTY = -1;
+    }
+#endif
     child_unblock();
     if ((int) strlen(arg0) >= PATH_MAX) {
 	zerr("command too long: %s", arg0);
@@ -944,7 +950,9 @@ entersubsh(int flags)
     }
     if (!(sigtrapped[SIGQUIT] & ZSIG_IGNORED))
 	signal_default(SIGQUIT);
-    opts[MONITOR] = opts[USEZLE] = 0;
+    if (!isset(POSIXJOBS))
+	opts[MONITOR] = 0;
+    opts[USEZLE] = 0;
     zleactive = 0;
     if (flags & ESUB_PGRP)
 	clearjobtab(monitor);