mirror of
https://github.com/ksherlock/mpw.git
synced 2024-11-23 22:30:51 +00:00
Add error message when loader can't load command (#55)
And change exit code from EX_CONFIG to EX_SOFTWARE.
This commit is contained in:
parent
022d4cffe9
commit
a76287876c
@ -957,10 +957,19 @@ int main(int argc, char **argv)
|
||||
|
||||
#ifdef LOADER_LOAD
|
||||
uint16_t err = Loader::Native::LoadFile(command);
|
||||
if (err) exit(EX_CONFIG);
|
||||
if (err) {
|
||||
const char *cp = ErrorName(err);
|
||||
fprintf(stderr, "Unable to load command %s: ", command.c_str());
|
||||
if (cp) printf("%s\n", cp);
|
||||
else printf("%hd\n", err);
|
||||
exit(EX_SOFTWARE);
|
||||
}
|
||||
#else
|
||||
uint32_t address = load(command.c_str());
|
||||
if (!address) exit(EX_CONFIG);
|
||||
if (!address) {
|
||||
fprintf(stderr, "Unable to load command %s\n", command.c_str());
|
||||
exit(EX_SOFTWARE);
|
||||
}
|
||||
#endif
|
||||
GlobalInit();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user