subd: automatically detect if callback frees subd.

This involves a tricky callback internally, but far less error-prone.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-10-12 17:05:04 +10:30
committed by Christian Decker
parent 5a256c724a
commit 0b953b86fe
7 changed files with 178 additions and 182 deletions

View File

@@ -9,7 +9,7 @@
#include <lightningd/peer_control.h>
#include <lightningd/subd.h>
static bool ping_reply(struct subd *subd, const u8 *msg, const int *fds,
static void ping_reply(struct subd *subd, const u8 *msg, const int *fds,
struct command *cmd)
{
u16 totlen;
@@ -33,7 +33,6 @@ static bool ping_reply(struct subd *subd, const u8 *msg, const int *fds,
json_object_end(response);
command_success(cmd, response);
}
return true;
}
static void json_dev_ping(struct command *cmd,