From: Ruben Kerkhof Date: Wed, 23 May 2018 13:41:25 +0000 (+0200) Subject: processes plugin: fix build warning X-Git-Tag: collectd-5.9.0~248 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=836632d6a83ad0eb17aed3ef1af011a3f96ead13;p=thirdparty%2Fcollectd.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 cfc579009..ffe6c5aa0 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; }