Browse Source

plugin: Exit if we fail to start a plugin

Signed-off-by: Christian Decker <@cdecker>
plugin-3
Christian Decker 6 years ago
committed by Rusty Russell
parent
commit
da465f0fdd
  1. 5
      lightningd/plugin.c

5
lightningd/plugin.c

@ -6,6 +6,7 @@
#include <ccan/opt/opt.h>
#include <ccan/pipecmd/pipecmd.h>
#include <ccan/tal/str/str.h>
#include <errno.h>
#include <lightningd/json.h>
#include <unistd.h>
@ -408,6 +409,10 @@ void plugins_init(struct plugins *plugins)
cmd[1] = NULL;
p->pid = pipecmdarr(&stdout, &stdin, NULL, cmd);
if (p->pid == -1)
fatal("error starting plugin '%s': %s", p->cmd,
strerror(errno));
list_head_init(&p->output);
p->buffer = tal_arr(p, char, 64);
p->used = 0;

Loading…
Cancel
Save