diff options
author | Simon Ser <contact@emersion.fr> | 2021-08-06 08:23:02 +0000 |
---|---|---|
committer | Kenny Levinsen <kl@kl.wtf> | 2021-08-06 22:27:42 +0200 |
commit | 3a843745c2dee17ec99d3c6b233251a5dc6ff5ad (patch) | |
tree | 573f81558e26884e104f7182af14a6c80ed3fee7 /seatd-launch | |
parent | f2a614dcd3b3e473df29a91ca9a7de77ef9b2609 (diff) |
seatd-launch: don't use gotos in child processes
While forked (child pid is zero), don't use gotos. These will
execute atexit functions and potentially mess up the stdlib.
Instead, use _exit.
Diffstat (limited to 'seatd-launch')
-rw-r--r-- | seatd-launch/seatd-launch.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/seatd-launch/seatd-launch.c b/seatd-launch/seatd-launch.c index 1b53699..cf9f93d 100644 --- a/seatd-launch/seatd-launch.c +++ b/seatd-launch/seatd-launch.c @@ -38,7 +38,7 @@ int main(int argc, char *argv[]) { // TODO: Make seatd accept the numeric UID execlp("seatd", "seatd", "-n", pipebuf, "-u", user->pw_name, "-s", sockbuf, NULL); perror("Could not start seatd"); - goto error; + _exit(1); } close(fds[1]); @@ -98,7 +98,7 @@ int main(int argc, char *argv[]) { setenv("SEATD_SOCK", sockbuf, 1); execv(argv[1], &argv[1]); perror("Could not start target"); - goto error_seatd; + _exit(1); } int status = 0; |