diff options
Diffstat (limited to 'alacritty_terminal/src/util.rs')
-rw-r--r-- | alacritty_terminal/src/util.rs | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/alacritty_terminal/src/util.rs b/alacritty_terminal/src/util.rs index 45b17353..7bc7c08b 100644 --- a/alacritty_terminal/src/util.rs +++ b/alacritty_terminal/src/util.rs @@ -87,29 +87,29 @@ where I: IntoIterator<Item = S>, S: AsRef<OsStr>, { - // TODO: Rust 1.34.0 - #[allow(deprecated)] - Command::new(program) - .args(args) - .stdin(Stdio::null()) - .stdout(Stdio::null()) - .stderr(Stdio::null()) - .before_exec(|| unsafe { - match ::libc::fork() { - -1 => return Err(io::Error::last_os_error()), - 0 => (), - _ => ::libc::_exit(0), - } - - if ::libc::setsid() == -1 { - return Err(io::Error::last_os_error()); - } - - Ok(()) - }) - .spawn()? - .wait() - .map(|_| ()) + unsafe { + Command::new(program) + .args(args) + .stdin(Stdio::null()) + .stdout(Stdio::null()) + .stderr(Stdio::null()) + .pre_exec(|| { + match ::libc::fork() { + -1 => return Err(io::Error::last_os_error()), + 0 => (), + _ => ::libc::_exit(0), + } + + if ::libc::setsid() == -1 { + return Err(io::Error::last_os_error()); + } + + Ok(()) + }) + .spawn()? + .wait() + .map(|_| ()) + } } #[cfg(windows)] |