X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Ftail.c;h=74fdf84aa35233110bed7a2315d677cb4830fbf3;hb=c4bce475033d055cf5370b33fc6b8675fad5667b;hp=b8922ecb388039098ebde1209cb69ed3ec464c13;hpb=f8e1e81d433c5b4e06792c2617abf0e6ec9e76d9;p=collectd.git diff --git a/src/tail.c b/src/tail.c index b8922ecb..74fdf84a 100644 --- a/src/tail.c +++ b/src/tail.c @@ -328,7 +328,6 @@ static int ctail_read (user_data_t *ud) static int ctail_init (void) { char str[255]; - user_data_t ud = { 0 }; if (tail_match_list_num == 0) { @@ -338,9 +337,12 @@ static int ctail_init (void) for (size_t i = 0; i < tail_match_list_num; i++) { - ud.data = (void *)tail_match_list[i]; ssnprintf(str, sizeof(str), "tail-%zu", i); - plugin_register_complex_read (NULL, str, ctail_read, tail_match_list_intervals[i], &ud); + + plugin_register_complex_read (NULL, str, ctail_read, tail_match_list_intervals[i], + &(user_data_t) { + .data = tail_match_list[i], + }); } return (0);