Skip to content

Commit

Permalink
Revert daemon removal
Browse files Browse the repository at this point in the history
This reverts the removal of the call to libc::daemon and instead adds an
annotation to ignore the deprecation warnings on macos.

This will not be an issue in the future since macOS is only discouraging
the use of `daemon`, but I'm not aware of any intention to actually
remove it.

This fixes #2211.
  • Loading branch information
chrisduerr committed Apr 1, 2019
1 parent a9c6e28 commit 5523f64
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
1 change: 0 additions & 1 deletion font/src/darwin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,6 @@ mod tests {
101...150 => '~',
151...200 => '*',
201...255 => '#',
_ => unreachable!(),
};
print!("{}", c);
}
Expand Down
11 changes: 4 additions & 7 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

use std::ffi::OsStr;
use std::process::Command;
use std::process::Stdio;
use std::{cmp, io};

#[cfg(not(windows))]
Expand All @@ -23,6 +22,8 @@ use std::os::unix::process::CommandExt;
#[cfg(windows)]
use std::os::windows::process::CommandExt;
#[cfg(windows)]
use std::process::Stdio;
#[cfg(windows)]
use winapi::um::winbase::{CREATE_NEW_PROCESS_GROUP, CREATE_NO_WINDOW};

/// Threading utilities
Expand Down Expand Up @@ -90,13 +91,9 @@ where
{
Command::new(program)
.args(args)
.stdin(Stdio::null())
.stdout(Stdio::null())
.stderr(Stdio::null())
.before_exec(|| unsafe {
if ::libc::fork() != 0 {
std::process::exit(0);
}
#[allow(deprecated)]
libc::daemon(1, 0);
Ok(())
})
.spawn()?
Expand Down

0 comments on commit 5523f64

Please sign in to comment.