diff options
author | Christian Duerr <chrisduerr@users.noreply.github.com> | 2019-07-30 22:13:51 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-30 22:13:51 +0000 |
commit | 86b9cdbabe495effed3559d2561f65efab9becaa (patch) | |
tree | 83577b53d79de856697d116d9a4062025f27b561 /alacritty_terminal/src/util.rs | |
parent | 72dfa477a9785289931e8e05dfc8244bb6a4e81c (diff) |
Bump minimum supported Rust version to 1.34.0
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)] |