X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fprocesses.c;h=ffe6c5aa0da38abaf5dc41985ec1c7d68ff53e0d;hb=0d5f3a040375be8936a85614e31c589f668cebaf;hp=2a4ce1f7ad9ad2312d58cc357ef7345c5f0241a7;hpb=7b0628b4f4688d48d89f94ca381ca6340da05b37;p=collectd.git diff --git a/src/processes.c b/src/processes.c index 2a4ce1f7..ffe6c5aa 100644 --- a/src/processes.c +++ b/src/processes.c @@ -293,7 +293,7 @@ typedef struct procstat { struct procstat_entry_s *instances; } procstat_t; -static procstat_t *list_head_g = NULL; +static procstat_t *list_head_g; static bool want_init = true; static bool report_ctx_switch; @@ -334,7 +334,7 @@ int getargs(void *processBuffer, int bufferLen, char *argsBuffer, int argsLen); #endif /* HAVE_PROCINFO_H */ #if HAVE_LIBTASKSTATS -static ts_t *taskstats_handle = NULL; +static ts_t *taskstats_handle; #endif /* put name of process from config to list_head_g tree @@ -995,8 +995,9 @@ static int ps_read_tasks_status(process_entry_t *ps) { tpid = ent->d_name; - if (snprintf(filename, sizeof(filename), "/proc/%li/task/%s/status", ps->id, - tpid) >= sizeof(filename)) { + int r = snprintf(filename, sizeof(filename), "/proc/%li/task/%s/status", + ps->id, tpid); + if ((size_t)r >= sizeof(filename)) { DEBUG("Filename too long: `%s'", filename); continue; }