summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Duerr <chrisduerr@users.noreply.github.com>2019-04-01 22:27:27 +0000
committerGitHub <noreply@github.com>2019-04-01 22:27:27 +0000
commit5523f64c6f939ced94d55c569f592320442e8eb9 (patch)
treec1a3977bdefdf0306670a9cb894a38c58040b43b
parenta9c6e2807f3a205ee1adc8adb732aac9215ea6cb (diff)
Revert daemon removal
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.
-rw-r--r--font/src/darwin/mod.rs1
-rw-r--r--src/util.rs11
2 files changed, 4 insertions, 8 deletions
diff --git a/font/src/darwin/mod.rs b/font/src/darwin/mod.rs
index 15a97e24..44cbdf30 100644
--- a/font/src/darwin/mod.rs
+++ b/font/src/darwin/mod.rs
@@ -622,7 +622,6 @@ mod tests {
101...150 => '~',
151...200 => '*',
201...255 => '#',
- _ => unreachable!(),
};
print!("{}", c);
}
diff --git a/src/util.rs b/src/util.rs
index 06e8436d..b70f2f16 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -14,7 +14,6 @@
use std::ffi::OsStr;
use std::process::Command;
-use std::process::Stdio;
use std::{cmp, io};
#[cfg(not(windows))]
@@ -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
@@ -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()?