mirror of
https://github.com/cloudflare/pingora.git
synced 2024-09-20 02:31:35 +02:00
Splitting out the daemon group_id type for MacOs and FreeBsd
This commit is contained in:
parent
5fde29f6fc
commit
e19d8c817d
2 changed files with 4 additions and 2 deletions
2
.bleep
2
.bleep
|
@ -1 +1 @@
|
||||||
bcd29d756e32a5d4cacae2a7468ee47d2ec03d0a
|
996a452a8ef2543944390046e383351d79c8e803
|
|
@ -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) };
|
||||||
|
|
Loading…
Reference in a new issue