Fix: ignore SIGPIPE
[lttng-tools.git] / src / bin / lttng-consumerd / lttng-consumerd.c
index 1636b9c0d22777798ff220df010c4bc5ca6c9634..1373a74b28212d5595d8c4f0dc18a89938e6a616 100644 (file)
@@ -99,14 +99,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);
        }
@@ -127,9 +119,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;
@@ -140,6 +133,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.02319 seconds and 4 git commands to generate.