[llvm-commits] [llvm] r78098 - /llvm/trunk/lib/System/Unix/Program.inc

Daniel Dunbar daniel at zuster.org
Tue Aug 4 13:32:49 PDT 2009


Author: ddunbar
Date: Tue Aug  4 15:32:25 2009
New Revision: 78098

URL: http://llvm.org/viewvc/llvm-project?rev=78098&view=rev
Log:
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).

Modified:
    llvm/trunk/lib/System/Unix/Program.inc

Modified: llvm/trunk/lib/System/Unix/Program.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Program.inc?rev=78098&r1=78097&r2=78098&view=diff

==============================================================================
--- llvm/trunk/lib/System/Unix/Program.inc (original)
+++ llvm/trunk/lib/System/Unix/Program.inc Tue Aug  4 15:32:25 2009
@@ -197,12 +197,12 @@
 
       // 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.





More information about the llvm-commits mailing list