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

cage: return exit code of primary client #270

Merged
merged 1 commit into from
Aug 21, 2023

Conversation

joggee-fr
Copy link
Collaborator

This PR resumes work from @pks-t in PR #170.
Main difference is no option is added, the exit code of the primary client is always returned if Cage terminates due to client exiting.

For example, silly command below now returns exit code 17.

./cage /bin/sh -- -c "exit 17"

In the other hand, if using the Wayland backend and closing the dedicated window for Cage keeps returning exit code 0 whatever the client return.


Some applications indicate different shutdown conditions by returning specific exit codes. One of these is e.g. Kodi, which returns 64 in case the user chose "Power off" and 66 in case the user chose "Reboot". In order to act on these exit codes, it thus makes sense in some situations to pass them on from the primary client to the caller of Cage.

This exit code is only returned if the primary client is the cause of Cage terminating.

cage.c Outdated Show resolved Hide resolved
@emersion
Copy link
Contributor

Overall looks good

Copy link
Contributor

@emersion emersion left a comment

Choose a reason for hiding this comment

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

Thanks!

@emersion emersion enabled auto-merge (rebase) August 21, 2023 11:37
@emersion emersion disabled auto-merge August 21, 2023 11:51
Some applications indicate different shutdown conditions by returning
specific exit codes. One of these is e.g. Kodi, which returns 64 in case
the user chose "Power off" and 66 in case the user chose "Reboot".
In order to act on these exit codes, it thus makes sense in some
situations to pass them on from the primary client to the caller of
Cage.

This exit code is only returned if the primary client is the cause of
Cage terminating.

Co-authored-by: Patrick Steinhardt <[email protected]>
@emersion emersion merged commit 121e3ac into cage-kiosk:master Aug 21, 2023
10 checks passed
@joggee-fr joggee-fr deleted the jg/exit-code branch August 21, 2023 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants