From 3093bbc21ad358c31ebcf0aa67a0ae7dabb7a361 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Mon, 14 Apr 2014 20:00:32 +0200 Subject: [PATCH] bug-fix (cpu-speed) --- README.md | 3 ++- systeminfo.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f3a2b08..206a46b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # systeminfo -Simple system monitoring library for node.js - Version 0.0.2 +Simple system monitoring library for node.js - Version 0.0.3 ## Core concept @@ -49,6 +49,7 @@ systeminfo.cpu(function(data) { | Version | Date | Comment | | -------------- | -------------- | -------- | +| 0.0.3 | 2014-04-14 | bug-fix (cpu_speed) | | 0.0.2 | 2014-03-14 | Optimization FS-Speed & CPU current speed | | 0.0.1 | 2014-03-13 | initial release | diff --git a/systeminfo.js b/systeminfo.js index 55b199f..36df8d7 100644 --- a/systeminfo.js +++ b/systeminfo.js @@ -220,9 +220,9 @@ exports.cpu_speed = function(callback) { } else { var output = ""; if (fs.existsSync("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq")) { - output = fs.readFileSync("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq"); + output = fs.readFileSync("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq").toString(); } else if (fs.existsSync("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq")) { - output = fs.readFileSync("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq"); + output = fs.readFileSync("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq").toString(); } if (output.trim()) { var lines = output.toString().split('\n');