From 5a5ae9fd163daaa270e5099446618fc272c04fc2 Mon Sep 17 00:00:00 2001 From: Mihai Parparita Date: Wed, 30 Aug 2023 23:10:46 -0700 Subject: [PATCH] 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). --- main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index 5b9a18a..f779d06 100644 --- a/main.cpp +++ b/main.cpp @@ -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 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: