From 1b46d01a5af29d8e7b336b7368d2ff76509e5941 Mon Sep 17 00:00:00 2001 From: Lagrang3 Date: Tue, 10 Feb 2026 10:14:45 +0100 Subject: [PATCH] reckless: fail reckless rpc if executable fails If the execution of reckless fails for some reason recklessrpc plugin should return an rpc failure message instead of hanging. Changelog-None. Signed-off-by: Lagrang3 --- plugins/recklessrpc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/recklessrpc.c b/plugins/recklessrpc.c index 510a3e55ddcd..5d3ebb5b2525 100644 --- a/plugins/recklessrpc.c +++ b/plugins/recklessrpc.c @@ -256,7 +256,11 @@ static struct command_result *reckless_call(struct command *cmd, reckless->pid = pipecmdarr(&reckless->stdinfd, &reckless->stdoutfd, &reckless->stderrfd, my_call); - /* FIXME: fail if invalid pid*/ + if (reckless->pid < 0) { + return command_fail(cmd, LIGHTNINGD, "reckless failed: %s", + strerror(errno)); + } + io_new_conn(reckless, reckless->stdoutfd, conn_init, reckless); io_new_conn(reckless, reckless->stderrfd, stderr_conn_init, reckless); tal_free(my_call);