Compare commits

...

2 Commits

Author SHA1 Message Date
RustDesk
9043c15acc Merge pull request #538 from fufesou/refact/ipc-trivial-changes
refact(ipc): trivial changes
2026-05-16 17:48:28 +08:00
fufesou
4bc2d76292 refact(ipc): trivial changes
Signed-off-by: fufesou <linlong1266@gmail.com>
2026-05-14 15:14:13 +08:00

View File

@@ -175,7 +175,7 @@ pub fn is_service_ipc_postfix(postfix: &str) -> bool {
} }
// Keep Linux/macOS IPC parent directory rules in one place to avoid drift between // Keep Linux/macOS IPC parent directory rules in one place to avoid drift between
// `ipc_path()` and Linux-only `ipc_path_for_uid()`. // `ipc_path()` and Unix `ipc_path_for_uid()`.
#[cfg(any(target_os = "linux", target_os = "macos"))] #[cfg(any(target_os = "linux", target_os = "macos"))]
#[inline] #[inline]
fn ipc_parent_dir_for_uid(uid: u32, postfix: &str) -> String { fn ipc_parent_dir_for_uid(uid: u32, postfix: &str) -> String {
@@ -871,7 +871,7 @@ impl Config {
} }
} }
#[cfg(target_os = "linux")] #[cfg(any(target_os = "linux", target_os = "macos"))]
pub fn ipc_path_for_uid(uid: u32, postfix: &str) -> String { pub fn ipc_path_for_uid(uid: u32, postfix: &str) -> String {
let parent = ipc_parent_dir_for_uid(uid, postfix); let parent = ipc_parent_dir_for_uid(uid, postfix);
format!("{parent}/ipc{postfix}") format!("{parent}/ipc{postfix}")
@@ -3523,7 +3523,7 @@ mod tests {
} }
#[test] #[test]
#[cfg(target_os = "linux")] #[cfg(any(target_os = "linux", target_os = "macos"))]
fn test_uinput_ipc_path_is_shared_across_uids() { fn test_uinput_ipc_path_is_shared_across_uids() {
const ROOT_UID: u32 = 0; const ROOT_UID: u32 = 0;
const USER_UID: u32 = 1000; const USER_UID: u32 = 1000;