Skip to content

Commit

Permalink
Fixed thinkfan writing out garbage to fan control
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
shuhaowu authored and Victor Mataré committed Sep 29, 2015
1 parent a4fe26c commit 9b27209
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion src/thinkfan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 9b27209

Please sign in to comment.