better error when unable to load executable.

This commit is contained in:
Kelvin Sherlock 2016-08-09 08:15:12 -04:00
parent fbb92ef08d
commit 56fc471255

View File

@ -682,8 +682,14 @@ int main(int argc, char **argv)
CreateStack();
uint16_t err = Loader::Native::LoadFile(command);
if (err) exit(EX_CONFIG);
{
auto rv = Loader::Native::LoadFile(command);
if (!rv) {
fprintf(stderr, "### Unable to load %s\n", command.c_str());
fprintf(stderr, "# %s (OS error %d)\n", ErrorName(rv.error()), rv.error());
exit(EX_CONFIG);
}
}
GlobalInit();