aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shell/ash.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 6173a2505..06c4698f9 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -4374,8 +4374,10 @@ clear_traps(void)
4374 } 4374 }
4375 } 4375 }
4376} 4376}
4377/* lives far away from here, needed for forkchild */ 4377
4378/* Lives far away from here, needed for forkchild */
4378static void closescript(void); 4379static void closescript(void);
4380/* Called after fork(), in child */
4379static void 4381static void
4380forkchild(struct job *jp, union node *n, int mode) 4382forkchild(struct job *jp, union node *n, int mode)
4381{ 4383{
@@ -4419,11 +4421,18 @@ forkchild(struct job *jp, union node *n, int mode)
4419 setsignal(SIGQUIT); 4421 setsignal(SIGQUIT);
4420 setsignal(SIGTERM); 4422 setsignal(SIGTERM);
4421 } 4423 }
4424#if JOBS
4425 /* For "jobs | cat" to work like in bash, we must retain list of jobs
4426 * in child, but we do need to remove ourself */
4427 freejob(jp);
4428#else
4422 for (jp = curjob; jp; jp = jp->prev_job) 4429 for (jp = curjob; jp; jp = jp->prev_job)
4423 freejob(jp); 4430 freejob(jp);
4431#endif
4424 jobless = 0; 4432 jobless = 0;
4425} 4433}
4426 4434
4435/* Called after fork(), in parent */
4427static void 4436static void
4428forkparent(struct job *jp, union node *n, int mode, pid_t pid) 4437forkparent(struct job *jp, union node *n, int mode, pid_t pid)
4429{ 4438{