changeset 254:320dbe44d3f6

add a patch to ignore sigpipe
author Louis Opter <kalessin@kalessin.fr>
date Sun, 16 Aug 2015 15:33:02 -0700
parents aecc19ba45d9
children f0ae1e79c4b0
files ignore_sigpipe.patch series
diffstat 2 files changed, 31 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ignore_sigpipe.patch	Sun Aug 16 15:33:02 2015 -0700
@@ -0,0 +1,30 @@
+# HG changeset patch
+# Parent  f2f2853633d97350ae110af1464739d0238d5530
+Ignore SIGPIPE
+
+It would be sad to die on this one, because a client decided to leave at
+the wrong moment.
+
+diff --git a/core/lightsd.c b/core/lightsd.c
+--- a/core/lightsd.c
++++ b/core/lightsd.c
+@@ -29,6 +29,7 @@
+ #include <stdio.h>
+ #include <stdint.h>
+ #include <stdlib.h>
++#include <signal.h>
+ #include <string.h>
+ #include <strings.h>
+ 
+@@ -123,6 +124,11 @@
+         );
+         evsignal_add(&sigevs[i], NULL);
+     }
++
++    struct sigaction act = { .sa_handler = SIG_IGN };
++    if (sigaction(SIGPIPE, &act, NULL)) {
++        lgtd_err(1, "can't configure signal handling");
++    }
+ }
+ 
+ static void
--- a/series	Sun Aug 16 00:48:06 2015 -0700
+++ b/series	Sun Aug 16 15:33:02 2015 -0700
@@ -1,5 +1,6 @@
 fix_addrtoa_mess.patch
 make_device_timeout_2_5x_force_refresh.patch
+ignore_sigpipe.patch
 add_start_stop_timer.patch
 expose_a_bunch_of_metadata_in_get_light_state.patch
 add_ipv4_to_ieee8023mac.patch #+future #+linux