CVS commit: src/bin/sh

"Robert Elz" <[email protected]>
Newsgroups gmane.os.netbsd.devel.cvs
Message-ID <[email protected]>
Module Name:	src
Committed By:	kre
Date:		Fri May 22 01:01:55 UTC 2026

Modified Files:
	src/bin/sh: trap.c

Log Message:
PR bin/60275  one more (should be the last) correction

It wasn't possible to do this, previously, but after the 3rd
in the sequence, we can (it should have been included with that one).

Never even look at gotsig[signo] in a vforked child - it will
be reflecting the state of the parent, not the child, so has
nothing to do with the child (this wasn't true until after the
3rd fix, which made sure that the child after a vfork doesn't
step on the parent's memory).

This will fix an unbelievably unlikely situation, where a
trapped signal arrives at the parent immediately before it
vforks() a child, which happens before the trap is executed.

Depending upon which of the various fixes (or none of them)
to this PR have been included various incorrect things might
have happened - the child might have processed the signal
trap instead of the parent, the signal might be lost, or even
processed twice....   Now the signal will be left for the
parent to process.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/bin/sh/trap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.