mirror of
https://github.com/sheumann/hush.git
synced 2024-11-05 06:07:00 +00:00
ash: make "jobs | cat" work like in bash (was giving empty output)
This commit is contained in:
parent
39125bec38
commit
bdc406d15d
11
shell/ash.c
11
shell/ash.c
@ -4374,8 +4374,10 @@ clear_traps(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* lives far away from here, needed for forkchild */
|
|
||||||
|
/* Lives far away from here, needed for forkchild */
|
||||||
static void closescript(void);
|
static void closescript(void);
|
||||||
|
/* Called after fork(), in child */
|
||||||
static void
|
static void
|
||||||
forkchild(struct job *jp, union node *n, int mode)
|
forkchild(struct job *jp, union node *n, int mode)
|
||||||
{
|
{
|
||||||
@ -4419,11 +4421,18 @@ forkchild(struct job *jp, union node *n, int mode)
|
|||||||
setsignal(SIGQUIT);
|
setsignal(SIGQUIT);
|
||||||
setsignal(SIGTERM);
|
setsignal(SIGTERM);
|
||||||
}
|
}
|
||||||
|
#if JOBS
|
||||||
|
/* For "jobs | cat" to work like in bash, we must retain list of jobs
|
||||||
|
* in child, but we do need to remove ourself */
|
||||||
|
freejob(jp);
|
||||||
|
#else
|
||||||
for (jp = curjob; jp; jp = jp->prev_job)
|
for (jp = curjob; jp; jp = jp->prev_job)
|
||||||
freejob(jp);
|
freejob(jp);
|
||||||
|
#endif
|
||||||
jobless = 0;
|
jobless = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Called after fork(), in parent */
|
||||||
static void
|
static void
|
||||||
forkparent(struct job *jp, union node *n, int mode, pid_t pid)
|
forkparent(struct job *jp, union node *n, int mode, pid_t pid)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user