1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 00:11:17 +02:00

diff hook: execute as the build user, and pass the temp dir

This commit is contained in:
Graham Christensen 2019-05-10 20:59:39 -04:00
parent c78686e411
commit 6df61db060
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C
5 changed files with 51 additions and 28 deletions

View file

@ -914,8 +914,8 @@ void killUser(uid_t uid)
/* Wrapper around vfork to prevent the child process from clobbering
the caller's stack frame in the parent. */
static pid_t doFork(bool allowVfork, std::function<void()> fun) __attribute__((noinline));
static pid_t doFork(bool allowVfork, std::function<void()> fun)
pid_t doFork(bool allowVfork, std::function<void()> fun) __attribute__((noinline));
pid_t doFork(bool allowVfork, std::function<void()> fun)
{
#ifdef __linux__
pid_t pid = allowVfork ? vfork() : fork();

View file

@ -265,6 +265,8 @@ string runProgram(Path program, bool searchPath = false,
const Strings & args = Strings(),
const std::optional<std::string> & input = {});
pid_t doFork(bool allowVfork, std::function<void()> fun);
struct RunOptions
{
Path program;