diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-03-24 01:15:06 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-03-24 01:15:06 +0100 |
commit | f49efbe0e58594260b768aaa9394abdc16122754 (patch) | |
tree | d151ce86175df004d0b6b7dff9e9e5ef7311cc7e /platform/linuxbsd/godot_linuxbsd.cpp | |
parent | cd4e4c0fccfdbfe04d91617a1bc6c4785dd6a1ec (diff) | |
parent | 023dcd44c1e628bb654b5472418d6a346b510a71 (diff) | |
download | redot-engine-f49efbe0e58594260b768aaa9394abdc16122754.tar.gz |
Merge pull request #89229 from akien-mga/main-refactor-os-exit-code
Refactor OS exit code to be `EXIT_SUCCESS` by default
Diffstat (limited to 'platform/linuxbsd/godot_linuxbsd.cpp')
-rw-r--r-- | platform/linuxbsd/godot_linuxbsd.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/platform/linuxbsd/godot_linuxbsd.cpp b/platform/linuxbsd/godot_linuxbsd.cpp index a2b6fbeb25..b0880c86b8 100644 --- a/platform/linuxbsd/godot_linuxbsd.cpp +++ b/platform/linuxbsd/godot_linuxbsd.cpp @@ -72,18 +72,19 @@ int main(int argc, char *argv[]) { char *ret = getcwd(cwd, PATH_MAX); Error err = Main::setup(argv[0], argc - 1, &argv[1]); + if (err != OK) { free(cwd); - if (err == ERR_HELP) { // Returned by --help and --version, so success. - return 0; + return EXIT_SUCCESS; } - return 255; + return EXIT_FAILURE; } - if (Main::start()) { - os.set_exit_code(EXIT_SUCCESS); - os.run(); // it is actually the OS that decides how to run + if (Main::start() == EXIT_SUCCESS) { + os.run(); + } else { + os.set_exit_code(EXIT_FAILURE); } Main::cleanup(); |