lightningd: ignore SIGPIPE.

It can happen when a peer hangs up, but also a JSON connection.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2016-11-10 23:29:35 +10:30
parent e7e7345596
commit bff81c0ecf

View File

@ -22,6 +22,7 @@
#include <ccan/timer/timer.h>
#include <errno.h>
#include <inttypes.h>
#include <signal.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/stat.h>
@ -525,6 +526,9 @@ int main(int argc, char *argv[])
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);