summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-07-11 19:06:51 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-07-11 19:06:51 +0000
commit653d6a0dd95668eb3ad0d92de985cf14c1f65a8d (patch)
treea79fc23a381e8103056906581334b474da9c30ab
parentbdfebe3e3262eaaf83e89c9356c7c46a21181a6a (diff)
downloadzsh-653d6a0dd95668eb3ad0d92de985cf14c1f65a8d.tar.gz
zsh-653d6a0dd95668eb3ad0d92de985cf14c1f65a8d.tar.xz
zsh-653d6a0dd95668eb3ad0d92de985cf14c1f65a8d.zip
27131: allow MONITOR in subshell by not closing SHTTY
-rw-r--r--ChangeLog6
-rw-r--r--Src/exec.c6
-rw-r--r--Src/jobs.c3
3 files changed, 8 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 4fbb406f1..52e2dc22e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2009-07-11  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
+	* 27131: Src/exec.c, Src/jobs.c: tentative attempt to
+	allow MONITOR option to be set in a subshell by not
+	closing SHTTY.
+
 	* 27129: Src/exec.c, Src/init.c, Src/zsh.h,
 	Test/A01grammar.ztst, Test/C04funcdef.ztst,
 	Test/D08cmdsubst.ztst: fix 27126 so as not to break the
@@ -11967,5 +11971,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4737 $
+* $Revision: 1.4738 $
 *****************************************************
diff --git a/Src/exec.c b/Src/exec.c
index 67d48b1ce..004459abf 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -931,11 +931,7 @@ entersubsh(int flags)
     zsh_subshell++;
     if ((flags & ESUB_REVERTPGRP) && getpid() == mypgrp)
 	release_pgrp();
-    if (SHTTY != -1) {
-	shout = NULL;
-	zclose(SHTTY);
-	SHTTY = -1;
-    }
+    shout = NULL;
     if (isset(MONITOR)) {
 	signal_default(SIGTTOU);
 	signal_default(SIGTTIN);
diff --git a/Src/jobs.c b/Src/jobs.c
index 6c673b74a..8e48ed4b8 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -1307,7 +1307,8 @@ clearjobtab(int monitor)
 
     if (monitor && oldmaxjob) {
 	int sz = oldmaxjob * sizeof(struct job);
-	DPUTS(oldjobtab != NULL, "BUG: saving job table twice\n");
+	if (oldjobtab)
+	    free(oldjobtab);
 	oldjobtab = (struct job *)zalloc(sz);
 	memcpy(oldjobtab, jobtab, sz);