From 635149e3abe5621de4952d3898c37e16a8822072 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 11 Jan 2017 10:21:01 -0800 Subject: [PATCH] signal: Ignore errors in signal handler Closes alexcrichton/tokio-signal#3 --- src/unix.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/unix.rs b/src/unix.rs index b5067c363..3b2efdb8d 100644 --- a/src/unix.rs +++ b/src/unix.rs @@ -348,14 +348,9 @@ extern fn handler(signum: c_int, }; if !state.ready.swap(true, Ordering::SeqCst) { - match (&(*GLOBAL_STATE).write).write(&[1]) { - Ok(..) => {} - Err(e) => { - if e.kind() != io::ErrorKind::WouldBlock { - panic!("bad error on write fd: {}", e) - } - } - } + // Ignore errors here as we're not in a context that can panic, + // and otherwise there's not much we can do. + drop((&(*GLOBAL_STATE).write).write(&[1])); } let fnptr = state.prev.sa_sigaction;