runtime: ignore SIGPIPE
This commit is contained in:
parent
285724b4f1
commit
57e8077942
1 changed files with 7 additions and 3 deletions
|
|
@ -23,6 +23,7 @@ pub fn install(el: &Rc<EventLoop>) -> Result<(), SighandError> {
|
||||||
let mut set: c::sigset_t = uapi::pod_zeroed();
|
let mut set: c::sigset_t = uapi::pod_zeroed();
|
||||||
uapi::sigaddset(&mut set, c::SIGINT).unwrap();
|
uapi::sigaddset(&mut set, c::SIGINT).unwrap();
|
||||||
uapi::sigaddset(&mut set, c::SIGTERM).unwrap();
|
uapi::sigaddset(&mut set, c::SIGTERM).unwrap();
|
||||||
|
uapi::sigaddset(&mut set, c::SIGPIPE).unwrap();
|
||||||
if let Err(e) = uapi::pthread_sigmask(c::SIG_BLOCK, Some(&set), None) {
|
if let Err(e) = uapi::pthread_sigmask(c::SIG_BLOCK, Some(&set), None) {
|
||||||
return Err(SighandError::BlockFailed(e.into()));
|
return Err(SighandError::BlockFailed(e.into()));
|
||||||
}
|
}
|
||||||
|
|
@ -59,9 +60,12 @@ impl EventLoopDispatcher for Sighand {
|
||||||
_ => return Err(Box::new(SighandError::ReadFailed(e.into()))),
|
_ => return Err(Box::new(SighandError::ReadFailed(e.into()))),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log::info!("Received signal {}", sigfd.ssi_signo);
|
let sig = sigfd.ssi_signo as i32;
|
||||||
log::info!("Exiting");
|
log::info!("Received signal {}", sig);
|
||||||
self.el.stop();
|
if matches!(sig, c::SIGINT | c::SIGTERM) {
|
||||||
|
log::info!("Exiting");
|
||||||
|
self.el.stop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue