summaryrefslogtreecommitdiff
path: root/tools/power/cpupower/lib/cpupower.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/power/cpupower/lib/cpupower.c')
-rw-r--r--tools/power/cpupower/lib/cpupower.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/power/cpupower/lib/cpupower.c b/tools/power/cpupower/lib/cpupower.c
index 3f7d0c0c5067..7a2ef691b20e 100644
--- a/tools/power/cpupower/lib/cpupower.c
+++ b/tools/power/cpupower/lib/cpupower.c
@@ -14,6 +14,13 @@
#include "cpupower.h"
#include "cpupower_intern.h"
+int is_valid_path(const char *path)
+{
+ if (access(path, F_OK) == -1)
+ return 0;
+ return 1;
+}
+
unsigned int cpupower_read_sysfs(const char *path, char *buf, size_t buflen)
{
ssize_t numread;