mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-18 13:55:23 -05:00
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.
This commit is contained in:
parent
a9c6e2807f
commit
5523f64c6f
2 changed files with 4 additions and 8 deletions
|
@ -622,7 +622,6 @@ mod tests {
|
||||||
101...150 => '~',
|
101...150 => '~',
|
||||||
151...200 => '*',
|
151...200 => '*',
|
||||||
201...255 => '#',
|
201...255 => '#',
|
||||||
_ => unreachable!(),
|
|
||||||
};
|
};
|
||||||
print!("{}", c);
|
print!("{}", c);
|
||||||
}
|
}
|
||||||
|
|
11
src/util.rs
11
src/util.rs
|
@ -14,7 +14,6 @@
|
||||||
|
|
||||||
use std::ffi::OsStr;
|
use std::ffi::OsStr;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
use std::process::Stdio;
|
|
||||||
use std::{cmp, io};
|
use std::{cmp, io};
|
||||||
|
|
||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
|
@ -23,6 +22,8 @@ use std::os::unix::process::CommandExt;
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
use std::os::windows::process::CommandExt;
|
use std::os::windows::process::CommandExt;
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
|
use std::process::Stdio;
|
||||||
|
#[cfg(windows)]
|
||||||
use winapi::um::winbase::{CREATE_NEW_PROCESS_GROUP, CREATE_NO_WINDOW};
|
use winapi::um::winbase::{CREATE_NEW_PROCESS_GROUP, CREATE_NO_WINDOW};
|
||||||
|
|
||||||
/// Threading utilities
|
/// Threading utilities
|
||||||
|
@ -90,13 +91,9 @@ where
|
||||||
{
|
{
|
||||||
Command::new(program)
|
Command::new(program)
|
||||||
.args(args)
|
.args(args)
|
||||||
.stdin(Stdio::null())
|
|
||||||
.stdout(Stdio::null())
|
|
||||||
.stderr(Stdio::null())
|
|
||||||
.before_exec(|| unsafe {
|
.before_exec(|| unsafe {
|
||||||
if ::libc::fork() != 0 {
|
#[allow(deprecated)]
|
||||||
std::process::exit(0);
|
libc::daemon(1, 0);
|
||||||
}
|
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
.spawn()?
|
.spawn()?
|
||||||
|
|
Loading…
Reference in a new issue