mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
lightningd: have plugin_send_getmanifest return an error string.
This way the caller doesn't have to "know" that it should use strerror(). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -59,6 +59,7 @@ static struct command_result *
|
||||
plugin_dynamic_start(struct command *cmd, const char *plugin_path)
|
||||
{
|
||||
struct plugin *p = plugin_register(cmd->ld->plugins, plugin_path, cmd);
|
||||
const char *err;
|
||||
|
||||
if (!p)
|
||||
return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
|
||||
@@ -66,10 +67,11 @@ plugin_dynamic_start(struct command *cmd, const char *plugin_path)
|
||||
plugin_path);
|
||||
|
||||
/* This will come back via plugin_cmd_killed or plugin_cmd_succeeded */
|
||||
if (!plugin_send_getmanifest(p))
|
||||
err = plugin_send_getmanifest(p);
|
||||
if (err)
|
||||
return command_fail(cmd, PLUGIN_ERROR,
|
||||
"%s: failed to open: %s",
|
||||
plugin_path, strerror(errno));
|
||||
"%s: %s",
|
||||
plugin_path, err);
|
||||
|
||||
return command_still_pending(cmd);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user