updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / khdapsmonitor / new_interface.patch
blob0f456d8674940c1cd9f4b8d561b51d786c44719e
1 diff -Naur khdapsmonitor-0.1.orig/src/sysfs.cpp khdapsmonitor-0.1/src/sysfs.cpp
2 --- khdapsmonitor-0.1.orig/src/sysfs.cpp 2009-02-26 00:33:07.054620129 +0100
3 +++ khdapsmonitor-0.1/src/sysfs.cpp 2009-02-26 00:37:59.585252020 +0100
4 @@ -62,8 +62,10 @@
5 while (i < deviceList.count())
7 if(QFile("/sys/block/" + deviceList[i] + "/queue/protect").exists())
8 - i++;
9 - else
10 + i++;
11 + else if (QFile("/sys/block/" + deviceList[i] + "/device/unload_heads").exists())
12 + i++;
13 + else
14 deviceList.remove(deviceList.at(i));
16 return deviceList;
17 @@ -71,5 +73,8 @@
19 bool SysFS::queueProtected(QString device)
21 - return fileBool("/sys/block/" + device + "/queue/protect");
22 + if (QFile("/sys/block/" + device + "/device/unload_heads").exists())
23 + return fileBool("/sys/block/" + device + "/device/unload_heads");
24 + else
25 + return fileBool("/sys/block/" + device + "/queue/protect");