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 c29c2baa ("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 Change-Id: Ieda8555fd03836bcd672a422fe673a8369ad9beb
Loading
Please register or sign in to comment