forge
Explore
Log in

Don't you dare go Hollow

Set SIGPIPE to SIG_DFL before printing in niri msg

Browse files at this commit

950fcf6328f9cf4a1a9c9b5808ce27352ac2f2a3Ivan MolodetskikhParent: 7ff2de1
src/ipc/client.rsmodified+5 -0
@@ -43,6 +43,11 @@ pub fn handle_msg(msg: Msg, json: bool) -> anyhow::Result<()> {
43 .map_err(|msg| anyhow!(msg))43 .map_err(|msg| anyhow!(msg))
44 .context("niri could not handle the request")?;44 .context("niri could not handle the request")?;
45 45
46+ // Default SIGPIPE so that our prints don't panic on stdout closing.
47+ unsafe {
48+ libc::signal(libc::SIGPIPE, libc::SIG_DFL);
49+ }
50+
46 match msg {51 match msg {
47 Msg::Outputs => {52 Msg::Outputs => {
48 let Response::Outputs(outputs) = response else {53 let Response::Outputs(outputs) = response else {