summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 99db6e4)
raw | patch | inline | side by side (parent: 99db6e4)
author | Marc Fournier <marc.fournier@camptocamp.com> | |
Wed, 10 Aug 2016 16:12:54 +0000 (18:12 +0200) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Wed, 10 Aug 2016 16:12:54 +0000 (18:12 +0200) |
src/turbostat.c | patch | blob | history |
diff --git a/src/turbostat.c b/src/turbostat.c
index a1faac4819856c3d8087aa4dfeb6a302f75495b7..2d8a08e646319b961f8ffb24f1a8654bb470c23f 100644 (file)
--- a/src/turbostat.c
+++ b/src/turbostat.c
check_permissions(void)
{
- int ret = 0;
-
if (getuid() == 0) {
/* We have everything we need */
return 0;
#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 "