Fix: ignore SIGPIPE
[lttng-tools.git] / src / bin / lttng-consumerd / lttng-consumerd.c
index c22cdd0fabeab9a2e7855e611ad3e2795e8c30cf..d4c42be67b7a396cd2d8c4a7badc47c43a1cddee 100644 (file)
@@ -101,14 +101,6 @@ static void sighandler(int sig)
                return;
        }
 
-       /*
-        * Ignore SIGPIPE because it should not stop the consumer whenever a
-        * SIGPIPE is caught through a FD operation.
-        */
-       if (sig == SIGPIPE) {
-               return;
-       }
-
        if (ctx) {
                lttng_consumer_should_exit(ctx);
        }
@@ -129,9 +121,10 @@ static int set_signal_handler(void)
                return ret;
        }
 
-       sa.sa_handler = sighandler;
        sa.sa_mask = sigset;
        sa.sa_flags = 0;
+
+       sa.sa_handler = sighandler;
        if ((ret = sigaction(SIGTERM, &sa, NULL)) < 0) {
                PERROR("sigaction");
                return ret;
@@ -142,6 +135,7 @@ static int set_signal_handler(void)
                return ret;
        }
 
+       sa.sa_handler = SIG_IGN;
        if ((ret = sigaction(SIGPIPE, &sa, NULL)) < 0) {
                PERROR("sigaction");
                return ret;
This page took 0.023104 seconds and 4 git commands to generate.