Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Godot exiting with unexpected failure code #67421

Merged
merged 1 commit into from
Oct 27, 2022

Conversation

Sauermann
Copy link
Contributor

@Sauermann Sauermann commented Oct 15, 2022

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 exits with EXIT_FAILURE.

This PR sets the exit code to EXIT_SUCCESS when initialization was successful just before starting the main loop.

resolve #62898

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.
@Sauermann Sauermann requested a review from a team as a code owner October 15, 2022 01:22
@Chaosus Chaosus added this to the 4.0 milestone Oct 15, 2022
Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me

@clayjohn clayjohn merged commit 9ffa863 into godotengine:master Oct 27, 2022
@clayjohn
Copy link
Member

Thanks!

@Sauermann Sauermann deleted the fix-failure-exit-code branch October 27, 2022 19:00
@ePirat ePirat mentioned this pull request Sep 10, 2023
@akien-mga
Copy link
Member

I think this might have been the wrong fix, and #83479 might be the better approach. At least, fixing this only for Linux was wrong, as shown in #81518.

We need to decide whether the default expectation is to fail (and thus we should mark success before any successful exit) or the other way around.

@Sauermann
Copy link
Contributor Author

If there is a better way for fixing the problem, then please revert this PR.
I am rather in favor of making success the default expectation, because in failure cases some additional handling is necessary anyway.

@akien-mga
Copy link
Member

I'm not sure yet what's the right solution, I would need to look more into it. #81518 would add feature parity with the approach from this PR in Windows and macOS (but not other platforms, if it matters).

@touilleMan
Copy link
Member

as mentioned here, I'm not sure this is the right solution ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Closing with window "x" button results in exit code 1
6 participants