From 60821bb3fb556ef4a3688a44034d8c15ecaafc37 Mon Sep 17 00:00:00 2001
From: Kubat <mael.martin31@gmail.com>
Date: Mon, 13 Jul 2020 10:30:35 +0200
Subject: [PATCH] Update src/main/lkt.c

---
 src/main/lkt.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/main/lkt.c b/src/main/lkt.c
index 44a44411..6fc02bbe 100644
--- a/src/main/lkt.c
+++ b/src/main/lkt.c
@@ -1060,14 +1060,12 @@ static struct lkt_cmd_opt options_[] = {
 
 /* The sigpipe function, if SIGPIPE signal is sent. */
 
-/*   <--- Commented to prevoid "define but not user" after commenting the corresponding assert in main
 static void
 sigpipe__(int sig)
 {
     LOG_ERROR("GENERAL", "Exit because of signal sigpipe (%d)", sig);
     exit(EXIT_FAILURE);
 }
-*/
 
 /* Functions declarations. */
 
@@ -1106,7 +1104,10 @@ main(int argc, const char **argv)
     log_level = ERROR;
     executable_name = "lkt";
     assert(NULL != setlocale(LC_ALL, "en_US.UTF-8"));   /* BECAUSE! */
-//    assert(!signal(SIGPIPE, sigpipe__));    <---- Commented because php exec command make the assert fail
+    if (signal(SIGPIPE, sigpipe__))
+    {
+        // LOG_ERROR("SYS", "%s", "Failed to install handler for SIGPIPE signal");
+    }
 
     args_t args = {
         .host = "localhost",
-- 
GitLab