[llvm-commits] [test-suite] r153024 - /test-suite/trunk/tools/timeit.c
Daniel Dunbar
daniel at zuster.org
Sun Mar 18 12:38:03 PDT 2012
Author: ddunbar
Date: Sun Mar 18 14:38:03 2012
New Revision: 153024
URL: http://llvm.org/viewvc/llvm-project?rev=153024&view=rev
Log:
[test-suite] tools/timeit: Line up exit codes with what RunSafely.sh expects.
Modified:
test-suite/trunk/tools/timeit.c
Modified: test-suite/trunk/tools/timeit.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/tools/timeit.c?rev=153024&r1=153023&r2=153024&view=diff
==============================================================================
--- test-suite/trunk/tools/timeit.c (original)
+++ test-suite/trunk/tools/timeit.c Sun Mar 18 14:38:03 2012
@@ -27,6 +27,8 @@
/* \brief Indicates a failure in exec() which usually means an invalid program
* name. */
EXITCODE_EXEC_FAILURE = 67,
+ EXITCODE_EXEC_NOENTRY = 127,
+ EXITCODE_EXEC_NOPERMISSION = 126,
/* \brief Indicates that we were unexpectedly signalled(). */
EXITCODE_SIGNALLED = 68,
@@ -179,7 +181,9 @@
if (WIFSIGNALED(status)) {
fprintf(stderr, "%s: error: child terminated by signal %d\n",
g_program_name, WTERMSIG(status));
- exit_status = EXITCODE_CHILD_SIGNALLED;
+
+ /* Propagate the signalled status to the caller. */
+ exit_status = 128 + WTERMSIG(status);
} else if (WIFEXITED(status)) {
exit_status = WEXITSTATUS(status);
} else {
@@ -312,6 +316,13 @@
execvp(argv[0], argv);
perror("execv");
+
+ if (errno == ENOENT) {
+ return EXITCODE_EXEC_NOENTRY;
+ } else if (errno == EACCES) {
+ return EXITCODE_EXEC_NOPERMISSION;
+ }
+
return EXITCODE_EXEC_FAILURE;
}
More information about the llvm-commits
mailing list