Author: sebor
Date: Wed May 28 12:17:30 2008
New Revision: 661053

URL: http://svn.apache.org/viewvc?rev=661053&view=rev
Log:
2008-05-28  Martin Sebor  <[EMAIL PROTECTED]>

        * util/exec.cpp (ENOENT): Defined macro if not defined in <errno.h>.
        (exec_file): Exited with status of 127 on ENOENT and 126 otherwise,
        as per POISIX. Removed unnecessary diagnostic output (handled by
        the parent instance of the same program).

Modified:
    stdcxx/branches/4.2.x/util/exec.cpp

Modified: stdcxx/branches/4.2.x/util/exec.cpp
URL: 
http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/util/exec.cpp?rev=661053&r1=661052&r2=661053&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/util/exec.cpp (original)
+++ stdcxx/branches/4.2.x/util/exec.cpp Wed May 28 12:17:30 2008
@@ -89,6 +89,9 @@
 #endif
 
 
+#ifndef ENOENT
+#  define ENOENT     1   /* Linux value */
+#endif
 #ifndef ESRCH
 #  define ESRCH      3   /* Linux value */
 #endif
@@ -866,10 +869,12 @@
 
         execv (options->argv [0], options->argv);
 
-        fprintf (error_file, "%s (%s): execv (\"%s\", ...) error: %s\n",
-                 exe_name, target_name, options->argv [0], strerror (errno));
+        /* POSIX specifies status of 127 when the executable doesn't
+         * exist and 126 for all other exec failures
+         */
+        if (ENOENT == errno)
+            exit (127);
 
-        /* POSIX specifies status of 126 for exec failures */
         exit (126);
     }
 


Reply via email to