libseat/seatd: call _exit() in the child

exit() will run all atexit registered functions and flush the standard
streams. When a process fork()s but does not exec(), doing so in the
child can clean up something the parent process does not expect, hence
_exit() is usually used instead.

This patch fixes duplicated prints to stdout, which broke the Weston
test suite. The test suite prints a TAP report to stdout in parts. The
child process in libseat gets a copy of the buffered stdout on fork().
Closing the libseat session flushed stdout with a partial TAP report in
the child, corrupting the final TAP report.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
Pekka Paalanen authored and Kenny Levinsen committed 2026-07-05 20:17:20 +02:00
1 parent 4bcdc81972
commit 737d3ca4e6
1 file changed
+1 -1
+1 -1
View File
@@ -716,7 +716,7 @@ static struct libseat *builtin_open_seat(const struct libseat_seat_listener *lis
error:
close(fd);
log_info("Stopped embedded seatd");
exit(res);
_exit(res);
} else {
close(fds[0]);
int fd = fds[1];