From 7d59a14db83bf8622cf4006ebd1d0b279a909f3d Mon Sep 17 00:00:00 2001 From: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Sat, 15 Oct 2022 03:17:40 +0200 Subject: [PATCH] Fix Godot exiting with unexpected failure code The exit code is initialized as EXIT_FAILURE to indicate failures during startup. Closing the Game window via the window manager does not change the exit code, so the program exists with EXIT_FAILURE. This PR set the exit code to EXIT_SUCCESS when initialization was successful just before starting the main loop. --- platform/linuxbsd/godot_linuxbsd.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/platform/linuxbsd/godot_linuxbsd.cpp b/platform/linuxbsd/godot_linuxbsd.cpp index 91a260182e6..fa5e20891cd 100644 --- a/platform/linuxbsd/godot_linuxbsd.cpp +++ b/platform/linuxbsd/godot_linuxbsd.cpp @@ -69,6 +69,7 @@ int main(int argc, char *argv[]) { } if (Main::start()) { + os.set_exit_code(EXIT_SUCCESS); os.run(); // it is actually the OS that decides how to run } Main::cleanup();