[client] clipboard/wayland: ignore SIGPIPE from clients that hang up

Otherwise, a badly-behaving client causes Looking Glass to receive a
SIGPIPE during Wayland copy operations. Handle EPIPE at call-sites
instead.

Co-authored-by: Quantum <quantum2048@gmail.com>
This commit is contained in:
Tudor Brindus
2021-01-09 19:46:41 -05:00
committed by Geoffrey McRae
parent 48941cb9c4
commit 2627381021
2 changed files with 9 additions and 1 deletions

View File

@@ -1861,6 +1861,12 @@ static int lg_run()
signal(SIGINT , int_handler);
signal(SIGTERM, int_handler);
// Request to receive EPIPE instead of SIGPIPE when one end of a pipe
// disconnects while a write is pending. This is useful to the Wayland
// clipboard backend, where an arbitrary application is on the other end of
// that pipe.
signal(SIGPIPE, SIG_IGN);
// try map the shared memory
if (!ivshmemOpen(&g_state.shm))
{