1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00

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

@ -400,6 +400,8 @@ void Goal::trace(const format & f)
/* Common initialisation performed in child processes. */
static void commonChildInit(Pipe & logPipe)
{
restoreSignals();
/* Put the child in a separate session (and thus a separate
process group) so that it has no controlling terminal (meaning
that e.g. ssh cannot open /dev/tty) and it doesn't receive
@ -2662,8 +2664,6 @@ void DerivationGoal::runChild()
for (auto & i : drv->args)
args.push_back(rewriteStrings(i, inputRewrites));
restoreSIGPIPE();
/* Indicate that we managed to set up the build environment. */
writeFull(STDERR_FILENO, string("\1\n"));