mirror of
https://github.com/cage-kiosk/cage.git
synced 2025-10-29 05:40:19 -04:00
cage: report on exit status of primary client
This commit is contained in:
parent
bb5d4cf52e
commit
b570cdb22c
1 changed files with 15 additions and 1 deletions
16
cage.c
16
cage.c
|
|
@ -69,6 +69,20 @@ spawn_primary_client(char *argv[], pid_t *pid_out)
|
|||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
cleanup_primary_client(pid_t pid)
|
||||
{
|
||||
int status;
|
||||
|
||||
waitpid(pid, &status, 0);
|
||||
|
||||
if (WIFEXITED(status)) {
|
||||
wlr_log(WLR_DEBUG, "Child exited normally with exit status %d", WEXITSTATUS(status));
|
||||
} else if (WIFSIGNALED(status)) {
|
||||
wlr_log(WLR_DEBUG, "Child was terminated by a signal (%d)", WTERMSIG(status));
|
||||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
drop_permissions(void)
|
||||
{
|
||||
|
|
@ -423,7 +437,7 @@ main(int argc, char *argv[])
|
|||
#endif
|
||||
wl_display_destroy_clients(server.wl_display);
|
||||
|
||||
waitpid(pid, NULL, 0);
|
||||
cleanup_primary_client(pid);
|
||||
|
||||
end:
|
||||
wl_event_source_remove(sigint_source);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue