Exit with a non-0 exit code if there are errors

More correct behavior (and makes the Infinite Mac wrapper not close
the emulated Mac, which it does when it thinks there was a graceful
shutdown).
This commit is contained in:
Mihai Parparita 2023-08-30 23:10:46 -07:00
parent 838ccdd7b4
commit 5a5ae9fd16
1 changed files with 4 additions and 4 deletions

View File

@ -140,7 +140,7 @@ int main(int argc, char** argv) {
machine_str = MachineFactory::machine_name_from_rom(bootrom_path);
if (machine_str.empty()) {
LOG_F(ERROR, "Could not autodetect machine");
return 0;
return 1;
}
else {
LOG_F(INFO, "Machine was autodetected as: %s", machine_str.c_str());
@ -150,7 +150,7 @@ int main(int argc, char** argv) {
/* handle overriding of machine settings from command line */
map<string, string> settings;
if (MachineFactory::get_machine_settings(machine_str, settings) < 0) {
return 0;
return 1;
}
CLI::App sa;
@ -168,7 +168,7 @@ int main(int argc, char** argv) {
if (SDL_Init(SDL_INIT_VIDEO)) {
LOG_F(ERROR, "SDL_Init error: %s", SDL_GetError());
return 0;
return 1;
}
// initialize global profiler object
@ -206,7 +206,7 @@ int main(int argc, char** argv) {
break;
default:
LOG_F(ERROR, "Invalid EXECUTION MODE");
return 0;
return 1;
}
bail: