[llvm-commits] [llvm] r117666 - /llvm/trunk/lib/System/Unix/Program.inc
Dan Gohman
gohman at apple.com
Fri Oct 29 10:20:42 PDT 2010
Author: djg
Date: Fri Oct 29 12:20:42 2010
New Revision: 117666
URL: http://llvm.org/viewvc/llvm-project?rev=117666&view=rev
Log:
Check if ErrMsg is null. This fixes the "not" command.
Modified:
llvm/trunk/lib/System/Unix/Program.inc
Modified: llvm/trunk/lib/System/Unix/Program.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Program.inc?rev=117666&r1=117665&r2=117666&view=diff
==============================================================================
--- llvm/trunk/lib/System/Unix/Program.inc (original)
+++ llvm/trunk/lib/System/Unix/Program.inc Fri Oct 29 12:20:42 2010
@@ -359,24 +359,29 @@
result = 126;
#endif
if (result == 127) {
- *ErrMsg = llvm::sys::StrError(ENOENT);
+ if (ErrMsg)
+ *ErrMsg = llvm::sys::StrError(ENOENT);
return -1;
}
if (result == 126) {
- *ErrMsg = "Program could not be executed";
+ if (ErrMsg)
+ *ErrMsg = "Program could not be executed";
return -1;
}
} else if (WIFSIGNALED(status)) {
- *ErrMsg = strsignal(WTERMSIG(status));
+ if (ErrMsg) {
+ *ErrMsg = strsignal(WTERMSIG(status));
#ifdef WCOREDUMP
- if (WCOREDUMP(status))
- *ErrMsg += " (core dumped)";
+ if (WCOREDUMP(status))
+ *ErrMsg += " (core dumped)";
#endif
+ }
return -1;
}
return result;
#else
- *ErrMsg = "Program::Wait is not implemented on this platform yet!";
+ if (ErrMsg)
+ *ErrMsg = "Program::Wait is not implemented on this platform yet!";
return -1;
#endif
}
More information about the llvm-commits
mailing list