From: Ruben Kerkhof Date: Wed, 23 May 2018 13:41:25 +0000 (+0200) Subject: processes plugin: fix build warning X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=836632d6a83ad0eb17aed3ef1af011a3f96ead13;p=collectd.git processes plugin: fix build warning src/processes.c:999:24: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare] tpid) >= sizeof(filename)) { ~~~~~ ^ ~~~~~~~~~~~~~~~~ --- diff --git a/src/processes.c b/src/processes.c index cfc57900..ffe6c5aa 100644 --- a/src/processes.c +++ b/src/processes.c @@ -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; }