diff options
author | Tom Cherry <tomcherry@google.com> | 2020-03-16 10:17:05 -0700 |
---|---|---|
committer | Tom Cherry <tomcherry@google.com> | 2020-03-18 09:42:56 -0700 |
commit | 2bf886afc29df3c0a774762d30f50a0e646cf872 (patch) | |
tree | ab7a83b7f9822d82969fbd816f03db76d44f9b85 /trusty/coverage/coverage_test.cpp | |
parent | c2872d831d1b4e6c60bcefbabfd6508f1333bc32 (diff) |
init: use a no-op signal handler instead of SIG_IGN for SIGPIPE
We want to ignore SIGPIPE within init, but if we use SIG_IGN, that
would be inherited by child processes through exec(), which we do not
want to have happen. We instead set up a real signal handler with a
no-op handler function, that will ignore SIGPIPE within init, but will
not be inherited across exec().
This fixes c29c2baa6907 ("init: Add support for native service
registration with lmkd"), when SIG_IGN was introduced.
Note that we caught this issue before shipping a release with that
change, so the major motivation here is to not cause a behavior change
in init.
Bug: 151581751
Test: children of init that don't explicitly block SIGPIPE exit when
sent SIGPIPE
Test: children of init that do explicitly block SIGPIPE do not exit
when sent SIGPIPE
Test: init does not exit when sent SIGPIPE
Test: init exits when sent SIGABRT
Merged-In: Ieda8555fd03836bcd672a422fe673a8369ad9beb
Change-Id: Ieda8555fd03836bcd672a422fe673a8369ad9beb
(cherry picked from commit fd470e87cc5920cde00c83e653a52c83cecbb04d)
Diffstat (limited to 'trusty/coverage/coverage_test.cpp')
0 files changed, 0 insertions, 0 deletions