diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-09-13 23:37:26 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-13 23:37:26 +0300 |
| commit | 6075d25f470a1145aa8240e64868cdfebc1dc348 (patch) | |
| tree | ceea1c35f741fb810b6919127b9224546261943e /src/platform/linux.rs | |
| parent | b847e6cdb6aa6ee113cc026dcbe1fe966a0c750f (diff) | |
fix: keep plugins working after client-only updates (#4077)
Diffstat (limited to 'src/platform/linux.rs')
| -rw-r--r-- | src/platform/linux.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/platform/linux.rs b/src/platform/linux.rs index 7b0755e1..d563512d 100644 --- a/src/platform/linux.rs +++ b/src/platform/linux.rs @@ -82,6 +82,26 @@ struct ProcGroupMember { state: char, } +pub(crate) fn launch_executable() -> std::io::Result<PathBuf> { + use std::os::unix::ffi::OsStrExt; + + let executable = std::env::current_exe()?; + if !executable.is_file() { + // Linux marks the old inode as deleted after an update replaces the binary. + if let Some(path) = executable + .as_os_str() + .as_bytes() + .strip_suffix(b" (deleted)") + { + let replacement = PathBuf::from(std::ffi::OsStr::from_bytes(path)); + if replacement.is_file() { + return Ok(replacement); + } + } + } + Ok(executable) +} + pub fn raise_server_nofile_limit() {} pub(crate) fn should_draw_host_cursor_by_default() -> bool { |
