llvm.org GIT mirror llvm / 9dbb79a
not is testing for a normal exit with a non-zero value. It shouldn't return success if the child process is killed with a signal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117701 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 8 years ago
1 changed file(s) with 11 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
88
99 #include "llvm/System/Path.h"
1010 #include "llvm/System/Program.h"
11 #include "llvm/Support/raw_ostream.h"
1112 using namespace llvm;
1213
1314 int main(int argc, const char **argv) {
1415 sys::Path Program = sys::Program::FindProgramByName(argv[1]);
15 return !sys::Program::ExecuteAndWait(Program, argv + 1);
16
17 std::string ErrMsg;
18 int Result = sys::Program::ExecuteAndWait(Program, argv + 1, 0, 0, 0, 0,
19 &ErrMsg);
20 if (Result < 0) {
21 errs() << "Error: " << ErrMsg << "\n";
22 return 1;
23 }
24
25 return Result == 0;
1626 }