Restore default signal handling in child processes

In particular, this fixes Ctrl-C in nix-shell sessions.
This commit is contained in:
Eelco Dolstra 2017-02-01 13:00:21 +01:00
parent 583ff4ec46
commit 7a65b2470e
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
7 changed files with 33 additions and 35 deletions

View file

@ -256,10 +256,6 @@ void closeMostFDs(const set<int> & exceptions);
/* Set the close-on-exec flag for the given file descriptor. */
void closeOnExec(int fd);
/* Restore default handling of SIGPIPE, otherwise some programs will
randomly say "Broken pipe". */
void restoreSIGPIPE();
/* User interruption. */
@ -423,6 +419,9 @@ void callSuccess(
on the current thread (and thus any threads created by it). */
void startSignalHandlerThread();
/* Restore default signal handling. */
void restoreSignals();
struct InterruptCallback
{
virtual ~InterruptCallback() { };