From 86b9cdbabe495effed3559d2561f65efab9becaa Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Tue, 30 Jul 2019 22:13:51 +0000 Subject: Bump minimum supported Rust version to 1.34.0 --- alacritty_terminal/src/util.rs | 46 +++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'alacritty_terminal/src/util.rs') 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, S: AsRef, { - // 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)] -- cgit