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/tty/unix.rs | |
parent | 72dfa477a9785289931e8e05dfc8244bb6a4e81c (diff) | |
download | alacritty-86b9cdbabe495effed3559d2561f65efab9becaa.tar.gz alacritty-86b9cdbabe495effed3559d2561f65efab9becaa.zip |
Bump minimum supported Rust version to 1.34.0
Diffstat (limited to 'alacritty_terminal/src/tty/unix.rs')
-rw-r--r-- | alacritty_terminal/src/tty/unix.rs | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/alacritty_terminal/src/tty/unix.rs b/alacritty_terminal/src/tty/unix.rs index cafa7027..f4c5771f 100644 --- a/alacritty_terminal/src/tty/unix.rs +++ b/alacritty_terminal/src/tty/unix.rs @@ -194,35 +194,30 @@ pub fn new<T: ToWinsize>(config: &Config, size: &T, window_id: Option<usize>) -> builder.env("WINDOWID", format!("{}", window_id)); } - // TODO: Rust 1.34.0 - #[allow(deprecated)] - builder.before_exec(move || { - // Create a new process group - unsafe { + unsafe { + builder.pre_exec(move || { + // Create a new process group let err = libc::setsid(); if err == -1 { die!("Failed to set session id: {}", errno()); } - } - set_controlling_terminal(slave); + set_controlling_terminal(slave); - // No longer need slave/master fds - unsafe { + // No longer need slave/master fds libc::close(slave); libc::close(master); - } - unsafe { libc::signal(libc::SIGCHLD, libc::SIG_DFL); libc::signal(libc::SIGHUP, libc::SIG_DFL); libc::signal(libc::SIGINT, libc::SIG_DFL); libc::signal(libc::SIGQUIT, libc::SIG_DFL); libc::signal(libc::SIGTERM, libc::SIG_DFL); libc::signal(libc::SIGALRM, libc::SIG_DFL); - } - Ok(()) - }); + + Ok(()) + }); + } // Handle set working directory option if let Some(ref dir) = config.working_directory() { |