mirror of
https://git.FreeBSD.org/src.git
synced 2024-11-28 08:02:54 +00:00
5807f35c54
Currently, we handle SIGINT by calling summary() and _exit() directly from the signal handler, which we install after setup(). There are several issues with this: * summary() is not signal safe; * the parent is not informed about the signal; * setup() can block on open(), and catching SIGINT at that stage will produce the correct exit status but will not print anything to stderr as POSIX demands. Fix this by making SIGINT non-restartable, changing our signal handler to only set a flag, installing it before setup(), and checking the termination flag before and after every blocking operation, i.e. open(), read(), write(). Also add two test cases, one for catching SIGINT while opening the input and one for catching it while reading. I couldn't think of an easy way to test catching SIGINT while writing (it's certainly feasible, but perhaps not from a shell script). MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: cracauer, ngie, imp Differential Revision: https://reviews.freebsd.org/D39641 |
||
---|---|---|
.. | ||
cat | ||
chflags | ||
chio | ||
chmod | ||
cp | ||
csh | ||
date | ||
dd | ||
df | ||
domainname | ||
echo | ||
ed | ||
expr | ||
freebsd-version | ||
getfacl | ||
hostname | ||
kenv | ||
kill | ||
ln | ||
ls | ||
mkdir | ||
mv | ||
nproc | ||
pax | ||
pkill | ||
ps | ||
pwait | ||
pwd | ||
realpath | ||
rm | ||
rmail | ||
rmdir | ||
setfacl | ||
sh | ||
sleep | ||
stty | ||
sync | ||
test | ||
tests | ||
timeout | ||
uuidgen | ||
Makefile | ||
Makefile.inc |