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:
parent
c78686e411
commit
6df61db060
5 changed files with 51 additions and 28 deletions
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue