about summary refs log tree commit diff
path: root/Src/zsh.h
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2016-09-15 11:42:28 +0100
committerPeter Stephenson <pws@zsh.org>2016-09-16 09:39:33 +0100
commit01ae64c0d74c17e36bfe6f52394a59754b8e8c92 (patch)
tree5c76926c158e8ef5460b86b1c5abc7dbc61a9151 /Src/zsh.h
parentd523ddaba2cd160343b54d3e38ea001c63a87dc6 (diff)
downloadzsh-01ae64c0d74c17e36bfe6f52394a59754b8e8c92.tar.gz
zsh-01ae64c0d74c17e36bfe6f52394a59754b8e8c92.tar.xz
zsh-01ae64c0d74c17e36bfe6f52394a59754b8e8c92.zip
39331: Reparent subjob on fork with exited superjob.
Fixes case of
  v() { { vim - } always { true } }
  ls | v
  ^Z
  fg

Tentative fix: still a race at exit where zsh forked by ^Z
is stopped when restarted.
Diffstat (limited to 'Src/zsh.h')
-rw-r--r--Src/zsh.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/Src/zsh.h b/Src/zsh.h
index 2dc5e7e2a..bb8ce130c 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -983,7 +983,8 @@ struct jobfile {
 
 struct job {
     pid_t gleader;		/* process group leader of this job  */
-    pid_t other;		/* subjob id or subshell pid         */
+    pid_t other;		/* subjob id (SUPERJOB)
+				 * or subshell pid (SUBJOB) */
     int stat;                   /* see STATs below                   */
     char *pwd;			/* current working dir of shell when *
 				 * this job was spawned              */
@@ -1015,6 +1016,8 @@ struct job {
 #define STAT_SUBLEADER  (0x2000) /* is super-job, but leader is sub-shell */
 
 #define STAT_BUILTIN    (0x4000) /* job at tail of pipeline is a builtin */
+#define STAT_SUBJOB_ORPHANED (0x8000)
+                                 /* STAT_SUBJOB with STAT_SUPERJOB exited */
 
 #define SP_RUNNING -1		/* fake status for jobs currently running */