busybox/include
Denys Vlasenko df154028dc 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>
2025-08-09 17:36:18 +02:00
..
.gitignore ash: allow shell scripts to be embedded in the binary 2018-11-01 10:15:13 +01:00
applet_metadata.h applet_tables: do not include libbb.h, that header ir for target builds 2011-03-28 01:23:38 +02:00
applets.h.sh modprobe-small: make applets individually selectable 2016-12-23 15:13:16 +01:00
applets.src.h Tweaks to build process for embedded scripts 2018-11-27 10:38:10 +01:00
ar_.h archival: avoid std namespace for local includes 2020-11-16 13:24:24 +01:00
bb_archive.h libarchive: remove duplicate forward declaration 2021-11-28 10:53:22 +01:00
bb_e2fs_defs.h lsattr: support more ext2 flags 2021-06-20 12:34:05 +02:00
busybox.h config: disentangle PREFER_APPLETS from SH_STANDALONE and SH_NOFORK 2016-07-22 18:48:38 +02:00
dump.h libbb/dump: make xxd_displayoff member conditional on xxd 2023-05-27 14:52:17 +02:00
fix_u32.h *: make GNU licensing statement forms more regular 2010-08-16 20:14:46 +02:00
grp_.h libpwdgrp: use FAST_FUNC to make "matching ABI" optimization more likely to succeed 2015-01-02 22:31:07 +01:00
inet_common.h more thorough fix for systems with strange socklen_t 2010-02-02 12:45:38 +01:00
libbb.h ash: eval: Add vfork support 2025-08-09 17:36:18 +02:00
liblzo_interface.h lzop: code shrink 2018-02-01 01:41:31 +01:00
platform.h top,pmap: speed up /smaps parsing 2025-08-06 14:42:06 +02:00
pwd_.h libpwdgrp: use getpwent() instead of getpwent_r() 2015-02-07 21:21:02 +01:00
rtc_.h hwclock: add get/set parameters option 2023-07-12 16:27:49 +02:00
shadow_.h libpwdgrp: use FAST_FUNC to make "matching ABI" optimization more likely to succeed 2015-01-02 22:31:07 +01:00
unicode.h ash,hush: recheck LANG before every line input 2011-03-23 17:59:27 +01:00
usage.src.h password applets: update help text 2025-07-18 07:28:32 +02:00
volume_id.h blkid: if parameters are given, do not scan /dev 2012-03-03 15:09:07 +01:00
xatonum.h udhcp: finish support of classless static routes 2011-12-16 17:05:52 +01:00
xregex.h *: make GNU licensing statement forms more regular 2010-08-16 20:14:46 +02:00