diff --git a/utils/not/not.cpp b/utils/not/not.cpp index dd89b8f11c0..908abe932d1 100644 --- a/utils/not/not.cpp +++ b/utils/not/not.cpp @@ -9,9 +9,19 @@ #include "llvm/System/Path.h" #include "llvm/System/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; }