mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-21 14:24:09 +01:00
plugin: Exit if we fail to start a plugin
Signed-off-by: Christian Decker <@cdecker>
This commit is contained in:
parent
879f9b7986
commit
da465f0fdd
1 changed files with 5 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue