mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-26 15:56:18 +02:00
assign environ to a temp variable to ensure liveness
This commit is contained in:
parent
8079ab87a2
commit
c0d55f9183
1 changed files with 6 additions and 3 deletions
|
@ -446,10 +446,13 @@ int main(int argc, char ** argv)
|
|||
? Strings{"bash", "--rcfile", rcfile}
|
||||
: Strings{"bash", rcfile};
|
||||
|
||||
environ = stringsToCharPtrs(envStrs).data();
|
||||
auto envPtrs = stringsToCharPtrs(envStrs);
|
||||
|
||||
execvp(getEnv("NIX_BUILD_SHELL", "bash").c_str(),
|
||||
stringsToCharPtrs(args).data());
|
||||
environ = envPtrs.data();
|
||||
|
||||
auto argPtrs = stringsToCharPtrs(args);
|
||||
|
||||
execvp(getEnv("NIX_BUILD_SHELL", "bash").c_str(), argPtrs.data());
|
||||
|
||||
throw SysError("executing shell");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue