From ef7f5537f9eda1d7f250c75c4b9b8d44e92ddbef Mon Sep 17 00:00:00 2001 From: hujianwei Date: Sun, 23 Oct 2022 05:41:59 +0000 Subject: [PATCH] Fix thinko in X clipboard setup code * xdata.c (XLInitXData): Ignore, not block, SIGPIPE. --- xdata.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xdata.c b/xdata.c index 57dace6..4570a30 100644 --- a/xdata.c +++ b/xdata.c @@ -2265,7 +2265,7 @@ XLNoteLocalPrimary (Seat *seat, PDataSource *source) void XLInitXData (void) { - sigset_t set; + struct sigaction act; int rc, fixes_error_base, major, minor; rc = XFixesQueryExtension (compositor.display, @@ -2309,13 +2309,13 @@ XLInitXData (void) /* Ignore SIGPIPE, since we could be writing to a pipe whose reading end was closed by the client. */ - sigemptyset (&set); - sigaddset (&set, SIGPIPE); + memset (&act, 0, sizeof act); + act.sa_handler = SIG_IGN; - if (pthread_sigmask (SIG_BLOCK, &set, NULL)) + if (sigaction (SIGPIPE, &act, NULL)) { - perror ("pthread_sigmask"); - exit (1); + perror ("sigaction"); + abort (); } }