Splitting out the daemon group_id type for MacOs and FreeBsd

This commit is contained in:
Kevin Guthrie 2024-04-19 18:01:55 -04:00 committed by Kevin Guthrie
parent 5fde29f6fc
commit e19d8c817d
2 changed files with 4 additions and 2 deletions

2
.bleep
View file

@ -1 +1 @@
bcd29d756e32a5d4cacae2a7468ee47d2ec03d0a 996a452a8ef2543944390046e383351d79c8e803

View file

@ -81,7 +81,9 @@ pub fn daemonize(conf: &ServerConf) {
Some(user) => { Some(user) => {
let user_cstr = CString::new(user.as_str()).unwrap(); let user_cstr = CString::new(user.as_str()).unwrap();
#[cfg(any(target_os = "freebsd", target_os = "macos"))] #[cfg(target_os = "macos")]
let group_id = unsafe { gid_for_username(&user_cstr).map(|gid| gid as i32) };
#[cfg(target_os = "freebsd")]
let group_id = unsafe { gid_for_username(&user_cstr).map(|gid| gid as u32) }; let group_id = unsafe { gid_for_username(&user_cstr).map(|gid| gid as u32) };
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
let group_id = unsafe { gid_for_username(&user_cstr) }; let group_id = unsafe { gid_for_username(&user_cstr) };