Skip to content

Commit 0f2d45d

Browse files
committed
in_kubernetes_events: move buffer vars for C89 compliance
Signed-off-by: Jesse Awan <jesse.awan@sap.com>
1 parent 15d87f9 commit 0f2d45d

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

plugins/in_kubernetes_events/kubernetes_events.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,11 @@ static int k8s_events_collect(struct flb_input_instance *ins,
994994
struct k8s_events *ctx = in_context;
995995
size_t bytes_consumed;
996996
int chunk_proc_ret;
997+
int buf_ret;
998+
int root_type;
999+
size_t consumed;
1000+
char *buf_data;
1001+
size_t buf_size;
9971002

9981003
if (pthread_mutex_trylock(&ctx->lock) != 0) {
9991004
FLB_INPUT_RETURN(0);
@@ -1028,11 +1033,8 @@ static int k8s_events_collect(struct flb_input_instance *ins,
10281033
* This handles the case where the last chunk doesn't end with a newline.
10291034
*/
10301035
if (ctx->chunk_buffer && flb_sds_len(ctx->chunk_buffer) > 0) {
1031-
int buf_ret;
1032-
int root_type;
1033-
size_t consumed = 0;
1034-
char *buf_data = NULL;
1035-
size_t buf_size;
1036+
consumed = 0;
1037+
buf_data = NULL;
10361038

10371039
buf_ret = flb_pack_json(ctx->chunk_buffer, flb_sds_len(ctx->chunk_buffer),
10381040
&buf_data, &buf_size, &root_type, &consumed);

0 commit comments

Comments
 (0)