summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System/Unix/Program.inc
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-08-04 20:32:25 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-08-04 20:32:25 +0000
commit8b6be17777176e25766f36cfb6466df9e04d6812 (patch)
tree2dd140c51c8dafa91d252f25f36410c8758d294e /llvm/lib/System/Unix/Program.inc
parent1584a295363ff298d082e184eefea8b783d6fc48 (diff)
downloadbcm5719-llvm-8b6be17777176e25766f36cfb6466df9e04d6812.tar.gz
bcm5719-llvm-8b6be17777176e25766f36cfb6466df9e04d6812.zip
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
Diffstat (limited to 'llvm/lib/System/Unix/Program.inc')
-rw-r--r--llvm/lib/System/Unix/Program.inc6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/System/Unix/Program.inc b/llvm/lib/System/Unix/Program.inc
index 3a562e45d41..d2baca80025 100644
--- a/llvm/lib/System/Unix/Program.inc
+++ b/llvm/lib/System/Unix/Program.inc
@@ -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.
OpenPOWER on IntegriCloud