mirror of
https://github.com/NixOS/nix
synced 2025-06-27 00:11:17 +02:00
Don't reset the logger in a vfork
9c766a40cb
broke logging from the
daemon, because commonChildInit is called when starting the build hook
in a vfork, so it ends up resetting the parent's logger. So don't
vfork.
It might be best to get rid of vfork altogether, but that may cause
problems, e.g. when we call an external program like git from the
evaluator.
This commit is contained in:
parent
ce9823d9b7
commit
c6718a9d95
3 changed files with 5 additions and 13 deletions
|
@ -939,9 +939,6 @@ void killUser(uid_t uid)
|
|||
users to which the current process can send signals. So we
|
||||
fork a process, switch to uid, and send a mass kill. */
|
||||
|
||||
ProcessOptions options;
|
||||
options.allowVfork = false;
|
||||
|
||||
Pid pid = startProcess([&]() {
|
||||
|
||||
if (setuid(uid) == -1)
|
||||
|
@ -964,7 +961,7 @@ void killUser(uid_t uid)
|
|||
}
|
||||
|
||||
_exit(0);
|
||||
}, options);
|
||||
});
|
||||
|
||||
int status = pid.wait();
|
||||
if (status != 0)
|
||||
|
@ -1085,8 +1082,7 @@ void runProgram2(const RunOptions & options)
|
|||
// vfork implies that the environment of the main process and the fork will
|
||||
// be shared (technically this is undefined, but in practice that's the
|
||||
// case), so we can't use it if we alter the environment
|
||||
if (options.environment)
|
||||
processOptions.allowVfork = false;
|
||||
processOptions.allowVfork = !options.environment;
|
||||
|
||||
/* Fork. */
|
||||
Pid pid = startProcess([&]() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue