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

Make sure we have an execvpe on Windows too

Necessary to fix a build (that was already broken in other ways) after
PR #11021.
This commit is contained in:
John Ericson 2024-08-26 15:42:09 -04:00
parent 88998fae74
commit dbabfc92d4
5 changed files with 20 additions and 5 deletions

View file

@ -420,10 +420,12 @@ bool statusOk(int status)
return WIFEXITED(status) && WEXITSTATUS(status) == 0;
}
int execvpe(const char * file0, char * const argv[], char * const envp[])
int execvpe(const char * file0, const char * const argv[], const char * const envp[])
{
auto file = ExecutablePath::load().findPath(file0).string();
return execve(file.c_str(), argv, envp);
auto file = ExecutablePath::load().findPath(file0);
// `const_cast` is safe. See the note in
// https://pubs.opengroup.org/onlinepubs/9799919799/functions/exec.html
return execve(file.c_str(), const_cast<char *const *>(argv), const_cast<char *const *>(envp));
}
}