From: Marc Fournier Date: Wed, 10 Aug 2016 16:12:54 +0000 (+0200) Subject: turbostat: avoid potential unused variable X-Git-Tag: collectd-5.6.0~57^2~2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=e6e6c0def969a116929fc1db9bc8a9127b2486d5;p=collectd.git turbostat: avoid potential unused variable --- diff --git a/src/turbostat.c b/src/turbostat.c index a1faac48..2d8a08e6 100644 --- a/src/turbostat.c +++ b/src/turbostat.c @@ -1475,8 +1475,6 @@ static int check_permissions(void) { - int ret = 0; - if (getuid() == 0) { /* We have everything we need */ return 0; @@ -1489,6 +1487,8 @@ check_permissions(void) #else /* HAVE_SYS_CAPABILITY_H && CAP_SYS_RAWIO */ } + int ret = 0; + if (check_capability(CAP_SYS_RAWIO) != 0) { WARNING("turbostat plugin: Collectd doesn't have the " "CAP_SYS_RAWIO capability. If you don't want to run "