forked from OSchip/llvm-project
When exec() fails, return 127 instead of errno; the parent process has no way to
distinguish that the result is errno, so it can't use it to provide more information about the error (it also exposes the numeric value of errno). llvm-svn: 78098
This commit is contained in:
parent
1584a29536
commit
8b6be17777
|
@ -197,12 +197,12 @@ Program::Execute(const Path& path,
|
|||
|
||||
// Execute!
|
||||
if (envp != 0)
|
||||
execve (path.c_str(), (char**)args, (char**)envp);
|
||||
execve(path.c_str(), (char**)args, (char**)envp);
|
||||
else
|
||||
execv (path.c_str(), (char**)args);
|
||||
execv(path.c_str(), (char**)args);
|
||||
// If the execve() failed, we should exit and let the parent pick up
|
||||
// our non-zero exit status.
|
||||
exit (errno);
|
||||
exit(127);
|
||||
}
|
||||
|
||||
// Parent process: Break out of the switch to do our processing.
|
||||
|
|
Loading…
Reference in New Issue