diff options
Diffstat (limited to 'src/hardware_cpu.cpp')
-rw-r--r-- | src/hardware_cpu.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/hardware_cpu.cpp b/src/hardware_cpu.cpp index c05e3ec..f0d939c 100644 --- a/src/hardware_cpu.cpp +++ b/src/hardware_cpu.cpp @@ -38,6 +38,7 @@ // system header #include <fcntl.h> +#include <unistd.h> /*! The default constructor of the class CPUInfo */ CPUInfo::CPUInfo() { @@ -123,7 +124,7 @@ int CPUInfo::checkCPUSpeed(){ new_value = -1; - fd = open(cpu_device, O_RDONLY); + fd = open(cpu_device.ascii(), O_RDONLY); if (read(fd, buf, 14) > 0){ new_value = strtol(buf, NULL, 10)/1000; close(fd); @@ -295,7 +296,7 @@ void CPUInfo::getCPUMaxSpeed() { // while (!access(cpu_device_max, R_OK)) { for (int cpu_id=0; cpu_id < numOfCPUs; cpu_id++) { - fd = open(cpu_device_max, O_RDONLY); + fd = open(cpu_device_max.ascii(), O_RDONLY); if (read(fd, buf, 14) > 0){ maxfreq = strtol(buf, NULL, 10)/1000; cpufreq_max_speed.append(maxfreq); |