diff --git a/include/fluent-bit.h b/include/fluent-bit.h index 70dafdbbff0..e050ad484bd 100644 --- a/include/fluent-bit.h +++ b/include/fluent-bit.h @@ -20,6 +20,10 @@ #ifndef FLUENT_BIT_H #define FLUENT_BIT_H +#ifdef __cplusplus +extern "C" { +#endif + #include #include #include @@ -29,4 +33,9 @@ #include #include #include + +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/flb_config.c b/src/flb_config.c index ec3d581fb94..ac696285d0c 100644 --- a/src/flb_config.c +++ b/src/flb_config.c @@ -26,7 +26,6 @@ struct flb_config *flb_config_init() { - int ret; struct flb_config *config; __flb_config_verbose = FLB_FALSE; diff --git a/src/flb_lib.c b/src/flb_lib.c index 4ec1b83f1c6..fa335d7a81a 100644 --- a/src/flb_lib.c +++ b/src/flb_lib.c @@ -107,6 +107,10 @@ int flb_lib_start(struct flb_config *config) mk_event_foreach(event, config->ch_evl) { fd = event->fd; bytes = read(fd, &val, sizeof(uint64_t)); + if (bytes <= 0) { + return -1; + } + if (val == FLB_ENGINE_STARTED) { flb_debug("[lib] backend started"); break;