diff options
author | Lukas Holecek <hluk@email.cz> | 2017-03-14 08:39:20 +0100 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2017-04-03 21:34:06 -0700 |
commit | 52c979bc0843dc2b820db97aaff8b58b6ad9d675 (patch) | |
tree | 4f6a4778823dc0d7d0ba60d54c7ad5278df17143 /src/tty.rs | |
parent | 4dcd7c4c0de86ee957b26a5fe1874404033f298b (diff) | |
download | alacritty-52c979bc0843dc2b820db97aaff8b58b6ad9d675.tar.gz alacritty-52c979bc0843dc2b820db97aaff8b58b6ad9d675.zip |
Fix hang on exit after child process failed
Quick test (works ~50%) is to press Ctrl+C followed by Ctrl+D.
Reproducible on Arch Linux with OpenGL from NVidia.
Fixes #228
Diffstat (limited to 'src/tty.rs')
-rw-r--r-- | src/tty.rs | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -21,7 +21,7 @@ use std::os::unix::process::CommandExt; use std::ptr; use std::process::{Command, Stdio}; -use libc::{self, winsize, c_int, pid_t, WNOHANG, WIFEXITED, WEXITSTATUS, SIGCHLD, TIOCSCTTY}; +use libc::{self, winsize, c_int, pid_t, WNOHANG, SIGCHLD, TIOCSCTTY}; use term::SizeInfo; use display::OnResize; @@ -48,15 +48,9 @@ extern "C" fn sigchld(_a: c_int) { die!("Waiting for pid {} failed: {}\n", PID, errno()); } - if PID != p { - return; + if PID == p { + SHOULD_EXIT = true; } - - if !WIFEXITED(status) || WEXITSTATUS(status) != 0 { - die!("child finished with error '{}'\n", status); - } - - SHOULD_EXIT = true; } } |