mirror of
https://github.com/fairyglade/ly.git
synced 2025-12-20 11:14:56 +00:00
Backport: Prevent Ly from zombifying when X.org is terminated
Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user