Skip to content

Commit

Permalink
plugin_proxy: Retrieve returned values from pre_run callbacks
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 committed Oct 2, 2023
1 parent 65433f6 commit 4038394
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/flb_plugin_proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,25 +287,27 @@ static int flb_proxy_input_cb_pre_run(struct flb_input_instance *ins,
{
struct flb_plugin_proxy_context *pc;
struct flb_plugin_proxy *proxy;
int ret;

pc = (struct flb_plugin_proxy_context *)(ins->context);
proxy = pc->proxy;

/* pre_run */
void (*cb_pre_run)(void);
int (*cb_pre_run)(void);

cb_pre_run = flb_plugin_proxy_symbol(proxy, "FLBPluginInputPreRun");
if (cb_pre_run != NULL) {
cb_pre_run();
ret = cb_pre_run();
}

return 0;
return ret;
}

static int flb_proxy_output_cb_pre_run(void *out_context, struct flb_config *config)
{
struct flb_plugin_proxy_context *ctx = out_context;
struct flb_plugin_proxy *proxy = (ctx->proxy);
int ret;

if (!out_context) {
return 0;
Expand All @@ -316,10 +318,10 @@ static int flb_proxy_output_cb_pre_run(void *out_context, struct flb_config *con

cb_pre_run = flb_plugin_proxy_symbol(proxy, "FLBPluginOutputPreRun");
if (cb_pre_run != NULL) {
cb_pre_run();
ret = cb_pre_run();
}

return 0;
return ret;
}

static int flb_proxy_register_output(struct flb_plugin_proxy *proxy,
Expand Down

0 comments on commit 4038394

Please sign in to comment.