From f530aba366d3f675c0465a57cb512220fb6f8464 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 29 May 2025 12:33:48 +0530 Subject: [PATCH] Use a non-zero size read to ensure it blocks --- kitty/launcher/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kitty/launcher/main.c b/kitty/launcher/main.c index 12f5b3cd1..b8c3c8ab1 100644 --- a/kitty/launcher/main.c +++ b/kitty/launcher/main.c @@ -411,7 +411,8 @@ handle_fast_commandline(CLISpec *cli_spec, const char *instance_group_prefix) { if (fork() != 0) { // wait until child has done setsid() before exiting so that it doesnt get a SIGHUP, // see: https://github.com/kovidgoyal/kitty/issues/8680 - errno = 0; while(read(fds[0], NULL, 0) == -1 && errno == EINTR); + char buf[4]; + errno = 0; while(read(fds[0], buf, sizeof(buf)) == -1 && errno == EINTR); exit(0); } errno = 0; while (close(fds[0]) != 0 && errno == EINTR);