diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-03-31 09:10:15 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-03-31 09:10:15 +0400 |
| commit | 950fcf6328f9cf4a1a9c9b5808ce27352ac2f2a3 (patch) | |
| tree | fb9b38ae5ab7343a565d79ee4b891ec8d7cb4108 | |
| parent | 7ff2de19b9304b3afdadb44aeeee4e85dfcb5218 (diff) | |
| download | niri-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.rs | 5 |
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 { |
