From 790e9d624ef356bfa1b695762fb03826520d4680 Mon Sep 17 00:00:00 2001 From: Shuhao Wu Date: Thu, 10 Sep 2015 21:01:39 -0400 Subject: [PATCH] Fixed thinkfan writing out garbage to fan control For some reason on the line that I changed, `cur_lvl == "V"`. Not sure why this is the case. This causes invalid argument to be thrown by the kernel, which crashes thinkfan. Also fixed the build process with CMake, which seems to be broken. --- CMakeLists.txt | 2 +- src/thinkfan.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e028e2f..c650e16 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ option(USE_ATASMART "Enable reading temperatures from HDDs via S.M.A.R.T") set(MAXERR 2 CACHE STRING "Fail after this many consecutive errors when in DANGEROUS mode") -add_executable(thinkfan thinkfan.c config.c message.c parser.c system.c) +add_executable(thinkfan src/thinkfan.c src/config.c src/message.c src/parser.c src/system.c) set(CMAKE_C_FLAGS_DEBUG "-O0 -g3 -Wall -DDEBUG") diff --git a/src/thinkfan.c b/src/thinkfan.c index b4be989..f656639 100644 --- a/src/thinkfan.c +++ b/src/thinkfan.c @@ -156,7 +156,7 @@ int fancontrol() { // Write current fan level to IBM_FAN one cycle before the watchdog // timeout ends, to let it know we're alive. if (unlikely((wt -= tmp_sleeptime) <= sleeptime)) { - config->setfan(); + set_fan; wt = watchdog_timeout; } -- 2.5.1