Browse Source

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>
ppa-0.6.1
Rusty Russell 8 years ago
parent
commit
bff81c0ecf
  1. 6
      daemon/lightningd.c

6
daemon/lightningd.c

@ -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>
@ -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);

Loading…
Cancel
Save