aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-03-31 09:10:15 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2024-03-31 09:10:15 +0400
commit950fcf6328f9cf4a1a9c9b5808ce27352ac2f2a3 (patch)
treefb9b38ae5ab7343a565d79ee4b891ec8d7cb4108
parent7ff2de19b9304b3afdadb44aeeee4e85dfcb5218 (diff)
downloadniri-950fcf6328f9cf4a1a9c9b5808ce27352ac2f2a3.tar.gz
niri-950fcf6328f9cf4a1a9c9b5808ce27352ac2f2a3.tar.bz2
niri-950fcf6328f9cf4a1a9c9b5808ce27352ac2f2a3.zip
Set SIGPIPE to SIG_DFL before printing in niri msg
-rw-r--r--src/ipc/client.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ipc/client.rs b/src/ipc/client.rs
index 424b243d..97413d0b 100644
--- a/src/ipc/client.rs
+++ b/src/ipc/client.rs
@@ -43,6 +43,11 @@ pub fn handle_msg(msg: Msg, json: bool) -> anyhow::Result<()> {
.map_err(|msg| anyhow!(msg))
.context("niri could not handle the request")?;
+ // Default SIGPIPE so that our prints don't panic on stdout closing.
+ unsafe {
+ libc::signal(libc::SIGPIPE, libc::SIG_DFL);
+ }
+
match msg {
Msg::Outputs => {
let Response::Outputs(outputs) = response else {