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.
This commit is contained in:
Simon Ser 2021-08-06 08:23:02 +00:00 committed by Kenny Levinsen
parent f2a614dcd3
commit 3a843745c2

View file

@ -38,7 +38,7 @@ int main(int argc, char *argv[]) {
// TODO: Make seatd accept the numeric UID // TODO: Make seatd accept the numeric UID
execlp("seatd", "seatd", "-n", pipebuf, "-u", user->pw_name, "-s", sockbuf, NULL); execlp("seatd", "seatd", "-n", pipebuf, "-u", user->pw_name, "-s", sockbuf, NULL);
perror("Could not start seatd"); perror("Could not start seatd");
goto error; _exit(1);
} }
close(fds[1]); close(fds[1]);
@ -98,7 +98,7 @@ int main(int argc, char *argv[]) {
setenv("SEATD_SOCK", sockbuf, 1); setenv("SEATD_SOCK", sockbuf, 1);
execv(argv[1], &argv[1]); execv(argv[1], &argv[1]);
perror("Could not start target"); perror("Could not start target");
goto error_seatd; _exit(1);
} }
int status = 0; int status = 0;