mirror of https://github.com/fairyglade/ly.git
Backport: Prevent Ly from zombifying when X.org is terminated
Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
parent
32d0de3d2d
commit
a9b6bfc62a
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue