diff options
Diffstat (limited to 'utils/not/not.cpp')
-rw-r--r-- | utils/not/not.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/utils/not/not.cpp b/utils/not/not.cpp index dd89b8f..9a924b5 100644 --- a/utils/not/not.cpp +++ b/utils/not/not.cpp @@ -7,11 +7,21 @@ // //===----------------------------------------------------------------------===// -#include "llvm/System/Path.h" -#include "llvm/System/Program.h" +#include "llvm/Support/Path.h" +#include "llvm/Support/Program.h" +#include "llvm/Support/raw_ostream.h" using namespace llvm; int main(int argc, const char **argv) { sys::Path Program = sys::Program::FindProgramByName(argv[1]); - return !sys::Program::ExecuteAndWait(Program, argv + 1); + + std::string ErrMsg; + int Result = sys::Program::ExecuteAndWait(Program, argv + 1, 0, 0, 0, 0, + &ErrMsg); + if (Result < 0) { + errs() << "Error: " << ErrMsg << "\n"; + return 1; + } + + return Result == 0; } |