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/tty/unix.rs | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'alacritty_terminal/src/tty/unix.rs') 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(config: &Config, size: &T, window_id: Option) -> 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() { -- cgit v1.2.3-54-g00ecf