Only use uzers on unix, do not fork on mac
This commit is contained in:
parent
62bfcc3550
commit
8c57060db2
3 changed files with 8 additions and 7 deletions
|
|
@ -55,7 +55,6 @@ rust-embed = "8"
|
|||
slotmap = "1.1.1"
|
||||
recently-used-xbel = "1.2.0"
|
||||
zip = "8"
|
||||
uzers = "0.12.2"
|
||||
md-5 = "0.10.6"
|
||||
png = "0.18"
|
||||
jxl-oxide = { version = "0.12.5", features = ["image"] }
|
||||
|
|
@ -130,6 +129,7 @@ debug = true
|
|||
|
||||
[target.'cfg(unix)'.dependencies]
|
||||
fork = "0.7"
|
||||
uzers = "0.12.2"
|
||||
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
procfs = "0.18"
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
}
|
||||
|
||||
if daemonize {
|
||||
#[cfg(all(unix, not(target_os = "redox")))]
|
||||
#[cfg(all(unix, not(any(target_os = "macos", target_os = "redox"))))]
|
||||
match fork::daemon(true, true) {
|
||||
Ok(fork::Fork::Child) => (),
|
||||
Ok(fork::Fork::Parent(_child_pid)) => process::exit(0),
|
||||
|
|
|
|||
11
src/tab.rs
11
src/tab.rs
|
|
@ -85,7 +85,6 @@ use crate::{
|
|||
thumbnailer::thumbnailer,
|
||||
trash::{Trash, TrashExt},
|
||||
};
|
||||
use uzers::{get_group_by_gid, get_user_by_uid};
|
||||
|
||||
pub const DOUBLE_CLICK_DURATION: Duration = Duration::from_millis(500);
|
||||
pub const HOVER_DURATION: Duration = Duration::from_millis(1600);
|
||||
|
|
@ -2429,7 +2428,7 @@ impl Item {
|
|||
|
||||
let mode = metadata.mode();
|
||||
|
||||
let user_name = get_user_by_uid(metadata.uid())
|
||||
let user_name = uzers::get_user_by_uid(metadata.uid())
|
||||
.and_then(|user| user.name().to_str().map(ToOwned::to_owned))
|
||||
.unwrap_or_default();
|
||||
let user_path = path.clone();
|
||||
|
|
@ -2452,7 +2451,7 @@ impl Item {
|
|||
)),
|
||||
);
|
||||
|
||||
let group_name = get_group_by_gid(metadata.gid())
|
||||
let group_name = uzers::get_group_by_gid(metadata.gid())
|
||||
.and_then(|group| group.name().to_str().map(ToOwned::to_owned))
|
||||
.unwrap_or_default();
|
||||
let group_path = path.clone();
|
||||
|
|
@ -6358,14 +6357,16 @@ impl Tab {
|
|||
total_size = total_size.saturating_add(metadata.len());
|
||||
}
|
||||
let mode = metadata.mode();
|
||||
#[cfg(unix)]
|
||||
user_name.insert(
|
||||
get_user_by_uid(metadata.uid())
|
||||
uzers::get_user_by_uid(metadata.uid())
|
||||
.and_then(|user| user.name().to_str().map(ToOwned::to_owned))
|
||||
.unwrap_or_default(),
|
||||
);
|
||||
mode_user.insert(get_mode_part(mode, MODE_SHIFT_USER));
|
||||
#[cfg(unix)]
|
||||
group_name.insert(
|
||||
get_group_by_gid(metadata.gid())
|
||||
uzers::get_group_by_gid(metadata.gid())
|
||||
.and_then(|group| group.name().to_str().map(ToOwned::to_owned))
|
||||
.unwrap_or_default(),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue