Backport: Prevent Ly from zombifying when X.org is terminated

Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
AnErrupTion 2025-08-05 21:49:38 +02:00
parent 32d0de3d2d
commit a9b6bfc62a
No known key found for this signature in database
1 changed files with 3 additions and 2 deletions

View File

@ -459,8 +459,9 @@ fn executeX11Cmd(shell: [*:0]const u8, pw_dir: [*:0]const u8, options: AuthOptio
_ = std.posix.waitpid(xorg_pid, 0); _ = std.posix.waitpid(xorg_pid, 0);
interop.xcb.xcb_disconnect(xcb); interop.xcb.xcb_disconnect(xcb);
std.posix.kill(x_pid, 0) catch return; std.posix.kill(x_pid, std.posix.SIG.TERM) catch {};
std.posix.kill(x_pid, std.posix.SIG.KILL) 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; var status: c_int = 0;
_ = std.c.waitpid(x_pid, &status, 0); _ = std.c.waitpid(x_pid, &status, 0);