summaryrefslogtreecommitdiff
path: root/lib/System
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
commit6db0a8b4fde6284b9812d59ad0467241b8301431 (patch)
treeb5a0d12771431deda780d4a6a63c8e0fc6501dd6 /lib/System
parentd03eecd063a18ce0c505a87afcb04db26c035bc9 (diff)
downloadllvm-6db0a8b4fde6284b9812d59ad0467241b8301431.tar.gz
llvm-6db0a8b4fde6284b9812d59ad0467241b8301431.tar.bz2
llvm-6db0a8b4fde6284b9812d59ad0467241b8301431.tar.xz
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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78098 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System')
-rw-r--r--lib/System/Unix/Program.inc6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/System/Unix/Program.inc b/lib/System/Unix/Program.inc
index 3a562e45d4..d2baca8002 100644
--- a/lib/System/Unix/Program.inc
+++ b/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.