|
From: <sv...@va...> - 2010-06-03 20:27:28
|
Author: sewardj
Date: 2010-06-03 21:27:19 +0100 (Thu, 03 Jun 2010)
New Revision: 11147
Log:
on MacOSX, correctly propagate failure code of system() call.
Modified:
trunk/coregrind/link_tool_exe.c
Modified: trunk/coregrind/link_tool_exe.c
===================================================================
--- trunk/coregrind/link_tool_exe.c 2010-06-03 08:19:59 UTC (rev 11146)
+++ trunk/coregrind/link_tool_exe.c 2010-06-03 20:27:19 UTC (rev 11147)
@@ -113,7 +113,7 @@
return failed ? 1 : 0;
}
-/* ------------------------- LINUX ------------------------- */
+/* ------------------------- DARWIN ------------------------ */
#elif defined(VGO_darwin)
@@ -129,8 +129,9 @@
int main ( int argc, char** argv )
{
- int i;
- size_t reqd = 0;
+ int i;
+ int/*bool*/ failed = 0;
+ size_t reqd = 0;
// expect at least: alt-load-address gcc -o foo bar.o
assert(argc > 5);
@@ -165,13 +166,13 @@
if (0) printf("\n");
int r = system(cmd);
+ if (r == -1 || WEXITSTATUS(r) != 0)
+ failed = 1;
free(cmd);
- // return the result of system. Note, we should handle it
- // properly; that would involve using WEXITSTATUS on the
- // value system gives back to us.
- return r;
+ // return the result of system.
+ return failed ? 1 : 0;
}
|