Skip to content

Commit

Permalink
Engine: rename cb_pre_exit to cb_exit
Browse files Browse the repository at this point in the history
  • Loading branch information
pandax381 committed Sep 2, 2015
1 parent 6eccbcf commit af0e21c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions include/fluent-bit/flb_input.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ struct flb_input_plugin {
*/
int (*cb_ingest) (void *in_context, void *, size_t);

/* Pre exit */
int (*cb_pre_exit) (void *, struct flb_config *);
/* Exit */
int (*cb_exit) (void *, struct flb_config *);

/* Input handler configuration */
void *in_context;
Expand Down Expand Up @@ -116,6 +116,6 @@ int flb_input_set_collector_event(char *name,
struct flb_config *config);
void flb_input_initialize_all(struct flb_config *config);
void flb_input_pre_run_all(struct flb_config *config);
void flb_input_pre_exit_all(struct flb_config *config);
void flb_input_exit_all(struct flb_config *config);

#endif
6 changes: 3 additions & 3 deletions include/fluent-bit/flb_output.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ struct flb_output_plugin {
/* Flush callback */
int (*cb_flush) (void *, size_t, void *, struct flb_config *);

/* Pre exit */
int (*cb_pre_exit) (void *, struct flb_config *);
/* Exit */
int (*cb_exit) (void *, struct flb_config *);

/* Output handler configuration */
void *out_context;
Expand All @@ -83,7 +83,7 @@ struct flb_output_plugin {

int flb_output_set(struct flb_config *config, char *output);
void flb_output_pre_run(struct flb_config *config);
void flb_output_pre_exit(struct flb_config *config);
void flb_output_exit(struct flb_config *config);
int flb_output_set_context(char *name, void *out_context, struct flb_config *config);
int flb_output_init(struct flb_config *config);

Expand Down
8 changes: 4 additions & 4 deletions src/flb_engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,10 @@ int flb_engine_start(struct flb_config *config)
if (event->type == FLB_ENGINE_EV_CORE) {
ret = flb_engine_handle_event(event->fd, event->mask, config);
if (ret == -1) {
/* Inputs pre-exit */
flb_input_pre_exit_all(config);
/* Outputs pre-exit */
flb_output_pre_exit(config);
/* Inputs exit */
flb_input_exit_all(config);
/* Outputs exit */
flb_output_exit(config);
return 0;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/flb_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,17 @@ void flb_input_pre_run_all(struct flb_config *config)
}
}

/* Invoke all pre-exit input callbacks */
void flb_input_pre_exit_all(struct flb_config *config)
/* Invoke all exit input callbacks */
void flb_input_exit_all(struct flb_config *config)
{
struct mk_list *head;
struct flb_input_plugin *in;

mk_list_foreach(head, &config->inputs) {
in = mk_list_entry(head, struct flb_input_plugin, _head);
if (in->active == FLB_TRUE) {
if (in->cb_pre_exit) {
in->cb_pre_exit(in->in_context, config);
if (in->cb_exit) {
in->cb_exit(in->in_context, config);
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/flb_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,18 +135,18 @@ void flb_output_pre_run(struct flb_config *config)
}
}

/* Invoke pre-exit call for the output plugin */
void flb_output_pre_exit(struct flb_config *config)
/* Invoke exit call for the output plugin */
void flb_output_exit(struct flb_config *config)
{
struct mk_list *head;
struct flb_output_plugin *out;

mk_list_foreach(head, &config->outputs) {
out = mk_list_entry(head, struct flb_output_plugin, _head);
if (out->active == FLB_TRUE) {
/* Check a pre-exit callback */
if (out->cb_pre_exit) {
out->cb_pre_exit(out->out_context, config);
/* Check a exit callback */
if (out->cb_exit) {
out->cb_exit(out->out_context, config);
}

if (out->upstream) {
Expand Down

0 comments on commit af0e21c

Please sign in to comment.