Skip to content

Commit

Permalink
input / config: use new pipe interface
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Dec 21, 2016
1 parent d65f471 commit 3c12cb2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 5 additions & 4 deletions include/fluent-bit/flb_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include <monkey/mk_core.h>
#include <fluent-bit/flb_info.h>
#include <fluent-bit/flb_pipe.h>
#include <fluent-bit/flb_log.h>
#include <fluent-bit/flb_task_map.h>

Expand Down Expand Up @@ -66,10 +67,10 @@ struct flb_config {
time_t init_time; /* Time when Fluent Bit started */

/* Used in library mode */
pthread_t worker; /* worker tid */
int ch_data[2]; /* pipe to communicate caller with worker */
int ch_manager[2]; /* channel to administrate fluent bit */
int ch_notif[2]; /* channel to receive notifications */
pthread_t worker; /* worker tid */
flb_pipefd_t ch_data[2]; /* pipe to communicate caller with worker */
flb_pipefd_t ch_manager[2]; /* channel to administrate fluent bit */
flb_pipefd_t ch_notif[2]; /* channel to receive notifications */

/* Channel event loop (just for ch_notif) */
struct mk_event_loop *ch_evl;
Expand Down
3 changes: 2 additions & 1 deletion src/flb_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <monkey/mk_core.h>
#include <fluent-bit/flb_lib.h>
#include <fluent-bit/flb_mem.h>
#include <fluent-bit/flb_pipe.h>
#include <fluent-bit/flb_engine.h>
#include <fluent-bit/flb_input.h>
#include <fluent-bit/flb_output.h>
Expand Down Expand Up @@ -100,7 +101,7 @@ flb_ctx_t *flb_create()
flb_log_init(config, FLB_LOG_STDERR, FLB_LOG_INFO, NULL);

/* Initialize our pipe to send data to our worker */
ret = pipe(config->ch_data);
ret = flb_pipe_create(config->ch_data);
if (ret == -1) {
perror("pipe");
flb_free(ctx);
Expand Down

0 comments on commit 3c12cb2

Please sign in to comment.