diff options
author | Simon Ser <contact@emersion.fr> | 2021-09-13 09:54:18 +0000 |
---|---|---|
committer | Kenny Levinsen <kl@kl.wtf> | 2021-09-13 13:39:20 +0200 |
commit | fe600eac2be9bd09d6c9746cf273a7eaed4e6f7f (patch) | |
tree | 22613a98196a0b8c42f294360e23c393d57ec749 /seatd-launch | |
parent | 8c85c46d2db93fcbb7ff1e0bbeaeb3e4dd0e71a1 (diff) |
seatd-launch: exit with status >128 if child is signalled
Mimick shells and exit with a status >128 if our child has been
signalled. Exiting with 128 + signal number is what most shells do
(POSIX only requires them to exit with >128).
Diffstat (limited to 'seatd-launch')
-rw-r--r-- | seatd-launch/seatd-launch.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/seatd-launch/seatd-launch.c b/seatd-launch/seatd-launch.c index 1877c98..ba61f5d 100644 --- a/seatd-launch/seatd-launch.c +++ b/seatd-launch/seatd-launch.c @@ -166,8 +166,10 @@ int main(int argc, char *argv[]) { if (WIFEXITED(status)) { return WEXITSTATUS(status); + } else if (WIFSIGNALED(status)) { + return 128 + WTERMSIG(status); } else { - return 1; + abort(); // unreachable } error_seatd: |