X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcsv.c;h=f9db5957d0df6abae173a2d373417a4fa694c5dc;hb=6fd0d2574fc386c2724c8307d33b12529b30048b;hp=7b513e7345199a508fc53531187aac959784c74b;hpb=50345eec33951b964e2829e83c30399b71f2baba;p=collectd.git diff --git a/src/csv.c b/src/csv.c index 7b513e73..f9db5957 100644 --- a/src/csv.c +++ b/src/csv.c @@ -22,6 +22,7 @@ **/ #include "collectd.h" + #include "plugin.h" #include "common.h" #include "utils_cache.h" @@ -269,7 +270,7 @@ static int csv_write (const data_set_t *ds, const value_list_t *vl, char values[4096]; FILE *csv; int csv_fd; - struct flock fl; + struct flock fl = { 0 }; int status; if (0 != strcmp (ds->type, vl->type)) { @@ -342,9 +343,6 @@ static int csv_write (const data_set_t *ds, const value_list_t *vl, } csv_fd = fileno (csv); - memset (&fl, '\0', sizeof (fl)); - fl.l_start = 0; - fl.l_len = 0; /* till end of file */ fl.l_pid = getpid (); fl.l_type = F_WRLCK; fl.l_whence = SEEK_SET;