mirror of
https://github.com/ksherlock/mpw.git
synced 2025-01-22 21:32:23 +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
|
#ifdef LOADER_LOAD
|
||||||
uint16_t err = Loader::Native::LoadFile(command);
|
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
|
#else
|
||||||
uint32_t address = load(command.c_str());
|
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
|
#endif
|
||||||
GlobalInit();
|
GlobalInit();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user