mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
loosen up systemd check because some systems block access to /proc/<pid>/exe
This commit is contained in:
@ -47,7 +47,9 @@ pub fn launchedBySystemd() bool {
|
|||||||
var link_buf: [std.fs.max_path_bytes]u8 = undefined;
|
var link_buf: [std.fs.max_path_bytes]u8 = undefined;
|
||||||
const link = std.fs.readLinkAbsolute(path, &link_buf) catch {
|
const link = std.fs.readLinkAbsolute(path, &link_buf) catch {
|
||||||
log.err("unable to read link '{s}'", .{path});
|
log.err("unable to read link '{s}'", .{path});
|
||||||
break :linux false;
|
// Some systems prohibit access to /proc/<pid>/exe for some
|
||||||
|
// reason so don't fail if we can't read the link.
|
||||||
|
break :linux true;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (std.mem.endsWith(u8, link, "/systemd")) break :linux true;
|
if (std.mem.endsWith(u8, link, "/systemd")) break :linux true;
|
||||||
|
Reference in New Issue
Block a user