summaryrefslogtreecommitdiff
path: root/utils/not
diff options
context:
space:
mode:
Diffstat (limited to 'utils/not')
-rw-r--r--utils/not/not.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/utils/not/not.cpp b/utils/not/not.cpp
index dd89b8f11c..908abe932d 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;
}