stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r661053 - /stdcxx/branches/4.2.x/util/exec.cpp
Date Wed, 28 May 2008 19:17:31 GMT
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  <sebor@roguewave.com>

	* 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);
     }
 



Mime
View raw message