aboutsummaryrefslogtreecommitdiff
path: root/include/libbb.h
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2025-08-09 17:36:18 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2025-08-09 17:36:18 +0200
commitdf154028dc1257a03cbbcf322a6c31eb9552a661 (patch)
tree58cb0eff7d98f8cfa29625a3ef81d6d898e7a9b1 /include/libbb.h
parent9f490785e00bd5c4deee09d9fee3badd8d70ada4 (diff)
downloadbusybox-w32-df154028dc1257a03cbbcf322a6c31eb9552a661.tar.gz
busybox-w32-df154028dc1257a03cbbcf322a6c31eb9552a661.tar.bz2
busybox-w32-df154028dc1257a03cbbcf322a6c31eb9552a661.zip
ash: eval: Add vfork support
Upstream commit: Date: Sat, 19 May 2018 02:39:56 +0800 eval: Add vfork support This patch adds basic vfork support for the case of a simple command. Upstream commit: Date: Tue, 12 Jan 2021 17:11:19 +1100 jobs: Always reset SIGINT/SIGQUIT handlers On Fri, Jan 08, 2021 at 08:55:41PM +0000, Harald van Dijk wrote: > On 18/05/2018 19:39, Herbert Xu wrote: > > This patch adds basic vfork support for the case of a simple command. > > ... @@ -879,17 +892,30 @@ forkchild(struct job *jp, union node *n, int > > mode) > > } > > } > > if (!oldlvl && iflag) { > > - setsignal(SIGINT); > > - setsignal(SIGQUIT); > > + if (mode != FORK_BG) { > > + setsignal(SIGINT); > > + setsignal(SIGQUIT); > > + } > > setsignal(SIGTERM); > > } > > + > > + if (lvforked) > > + return; > > + > > for (jp = curjob; jp; jp = jp->prev_job) > > freejob(jp); > > } > > This leaves SIGQUIT ignored in background jobs in interactive shells. > > ENV= dash -ic 'dash -c "kill -QUIT \$\$; echo huh" & wait' > > As of dash 0.5.11, this prints "huh". Before, the subprocess process killed > itself before it could print anything. Other shells do not leave SIGQUIT > ignored. > > (In a few other shells, this also prints "huh", but in those other shells, > that is because the inner shell chooses to ignore SIGQUIT, not because the > outer shell leaves it ignored.) Thanks for catching this. I have no idea how that got in there and it makes no sense whatsoever. This patch removes the if conditional. Fixes: e94a964e7dd0 ("eval: Add vfork support") Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include/libbb.h')
-rw-r--r--include/libbb.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h
index fba898943..4b3319824 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -643,6 +643,8 @@ int sigaction_set(int sig, const struct sigaction *act) FAST_FUNC;
643int sigprocmask_allsigs(int how) FAST_FUNC; 643int sigprocmask_allsigs(int how) FAST_FUNC;
644/* Return old set in the same set: */ 644/* Return old set in the same set: */
645int sigprocmask2(int how, sigset_t *set) FAST_FUNC; 645int sigprocmask2(int how, sigset_t *set) FAST_FUNC;
646/* SIG_BLOCK all signals, return old set: */
647int sigblockall(sigset_t *set) FAST_FUNC;
646/* Standard handler which just records signo */ 648/* Standard handler which just records signo */
647extern smallint bb_got_signal; 649extern smallint bb_got_signal;
648void record_signo(int signo); /* not FAST_FUNC! */ 650void record_signo(int signo); /* not FAST_FUNC! */