X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fvserver.c;h=1615ca04a1fc1bdbb2c22650e4397f49f80ee552;hb=61a1fa91ba73e4fe3a34949f77c5f017056f2b7a;hp=f295e49a9daf46f81e63c62f734a74bd6ca0ce8e;hpb=4fcf23160e7d3fd034dc7e807cbf4047970dd218;p=collectd.git diff --git a/src/vserver.c b/src/vserver.c index f295e49a..1615ca04 100644 --- a/src/vserver.c +++ b/src/vserver.c @@ -58,7 +58,6 @@ static void traffic_submit (const char *plugin_instance, vl.values = values; vl.values_len = STATIC_ARRAY_SIZE (values); - vl.time = time (NULL); sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "vserver", sizeof (vl.plugin)); sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance)); @@ -80,7 +79,6 @@ static void load_submit (const char *plugin_instance, vl.values = values; vl.values_len = STATIC_ARRAY_SIZE (values); - vl.time = time (NULL); sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "vserver", sizeof (vl.plugin)); sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance)); @@ -100,7 +98,6 @@ static void submit_gauge (const char *plugin_instance, const char *type, vl.values = values; vl.values_len = STATIC_ARRAY_SIZE (values); - vl.time = time (NULL); sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "vserver", sizeof (vl.plugin)); sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance)); @@ -144,7 +141,7 @@ static int vserver_read (void) while (42) { - size_t len; + int len; char file[BUFSIZE]; FILE *fh; @@ -173,7 +170,7 @@ static int vserver_read (void) if (dent->d_name[0] == '.') continue; - len = snprintf (file, sizeof (file), PROCDIR "/%s", dent->d_name); + len = ssnprintf (file, sizeof (file), PROCDIR "/%s", dent->d_name); if ((len < 0) || (len >= BUFSIZE)) continue; @@ -192,7 +189,7 @@ static int vserver_read (void) /* socket message accounting */ len = ssnprintf (file, sizeof (file), PROCDIR "/%s/cacct", dent->d_name); - if ((len < 0) || (len >= sizeof (file))) + if ((len < 0) || ((size_t) len >= sizeof (file))) continue; if (NULL == (fh = fopen (file, "r"))) @@ -240,7 +237,7 @@ static int vserver_read (void) /* thread information and load */ len = ssnprintf (file, sizeof (file), PROCDIR "/%s/cvirt", dent->d_name); - if ((len < 0) || (len >= sizeof (file))) + if ((len < 0) || ((size_t) len >= sizeof (file))) continue; if (NULL == (fh = fopen (file, "r"))) @@ -293,7 +290,7 @@ static int vserver_read (void) /* processes and memory usage */ len = ssnprintf (file, sizeof (file), PROCDIR "/%s/limit", dent->d_name); - if ((len < 0) || (len >= sizeof (file))) + if ((len < 0) || ((size_t) len >= sizeof (file))) continue; if (NULL == (fh = fopen (file, "r")))