mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-09 16:14:19 +01:00
plugin: Exit if we fail to start a plugin
Signed-off-by: Christian Decker <@cdecker>
This commit is contained in:
committed by
Rusty Russell
parent
879f9b7986
commit
da465f0fdd
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user