From a9b6bfc62a6b22e4408ceff4f95ea8a6c8e74fda Mon Sep 17 00:00:00 2001 From: AnErrupTion Date: Tue, 5 Aug 2025 21:49:38 +0200 Subject: [PATCH] Backport: Prevent Ly from zombifying when X.org is terminated Signed-off-by: AnErrupTion --- src/auth.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/auth.zig b/src/auth.zig index 68204e2..595f18c 100644 --- a/src/auth.zig +++ b/src/auth.zig @@ -459,8 +459,9 @@ fn executeX11Cmd(shell: [*:0]const u8, pw_dir: [*:0]const u8, options: AuthOptio _ = std.posix.waitpid(xorg_pid, 0); interop.xcb.xcb_disconnect(xcb); - std.posix.kill(x_pid, 0) catch return; - std.posix.kill(x_pid, std.posix.SIG.KILL) catch {}; + std.posix.kill(x_pid, std.posix.SIG.TERM) catch {}; + std.Thread.sleep(std.time.ns_per_s * 1); // Wait 1 second before sending SIGKILL + std.posix.kill(x_pid, std.posix.SIG.KILL) catch return; var status: c_int = 0; _ = std.c.waitpid(x_pid, &status, 0);