From 3a843745c2dee17ec99d3c6b233251a5dc6ff5ad Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 6 Aug 2021 08:23:02 +0000 Subject: 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. --- seatd-launch/seatd-launch.c | 4 ++-- 1 file 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; -- cgit v1.2.3