From 9253381d72ff3d22196d62176a7df51ce5f8fb3e Mon Sep 17 00:00:00 2001 From: grialion <48643945+grialion@users.noreply.github.com> Date: Sat, 17 Jan 2026 17:15:04 +0100 Subject: [PATCH] fix: fflush(NULL) before fork --- src/auth.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/auth.c b/src/auth.c index 0e97f61..bda6ac8 100644 --- a/src/auth.c +++ b/src/auth.c @@ -180,6 +180,7 @@ static void launch_with_xorg_server(struct session_exec* NNULLABLE exec, int xorg_pipefd[2]; if (pipe(xorg_pipefd) == -1) _exit(EXIT_FAILURE); + (void)fflush(NULL); pid_t xorg_pid = fork(); if (xorg_pid == 0) { start_xorg_server(pw, envlist, xorg_pipefd); @@ -206,6 +207,7 @@ static void launch_with_xorg_server(struct session_exec* NNULLABLE exec, _exit(EXIT_FAILURE); } + (void)fflush(NULL); pid_t xorg_session_pid = fork(); if (xorg_session_pid == 0) { int exit = session_exec_exec(exec, envlist);