ignore SIGPIPE to prevent crash on DnD/clipboard pipe close

Wayland data transfers (drag-and-drop, clipboard) use pipes between
clients. If a client disconnects mid-transfer, writing to the pipe
raises SIGPIPE which kills the compositor. Ignore it.
This commit is contained in:
lkn 2026-06-23 13:34:07 +02:00
parent 89393e1782
commit 8c306b3e3c
1 changed files with 4 additions and 0 deletions

View File

@ -638,6 +638,10 @@ static int real_main(int argc, char **argv)
sigemptyset(&ss);
sigaddset(&ss, SIGUSR2);
pthread_sigmask(SIG_BLOCK, &ss, NULL);
/* Ignore SIGPIPE — Wayland data transfers (DnD, clipboard)
* can trigger broken pipes when clients disconnect. */
signal(SIGPIPE, SIG_IGN);
}
setlocale(LC_ALL, "");