From bff81c0ecf31147338a13fbaef2d8dca236e2871 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 10 Nov 2016 23:29:35 +1030 Subject: [PATCH] lightningd: ignore SIGPIPE. It can happen when a peer hangs up, but also a JSON connection. Signed-off-by: Rusty Russell --- daemon/lightningd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/daemon/lightningd.c b/daemon/lightningd.c index bf0deb41c..e568daa6d 100644 --- a/daemon/lightningd.c +++ b/daemon/lightningd.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -524,7 +525,10 @@ int main(int argc, char *argv[]) errx(1, "no arguments accepted"); check_config(dstate); - + + /* Ignore SIGPIPE: we look at our write return values*/ + signal(SIGPIPE, SIG_IGN); + /* Set up node ID and private key. */ secrets_init(dstate); new_node(dstate, &dstate->id);