mirror of
https://github.com/cage-kiosk/cage.git
synced 2026-03-03 01:41:28 -05: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;
|
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
|
static bool
|
||||||
drop_permissions(void)
|
drop_permissions(void)
|
||||||
{
|
{
|
||||||
|
|
@ -423,7 +437,7 @@ main(int argc, char *argv[])
|
||||||
#endif
|
#endif
|
||||||
wl_display_destroy_clients(server.wl_display);
|
wl_display_destroy_clients(server.wl_display);
|
||||||
|
|
||||||
waitpid(pid, NULL, 0);
|
cleanup_primary_client(pid);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
wl_event_source_remove(sigint_source);
|
wl_event_source_remove(sigint_source);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue