+2008-12-14
+ * Fix disk_protect for linux-2.6.27 (and hopefully above)
+
2008-12-09
* Add an option to timed_thread_test() to not wait for the interval period
(so that IMAP IDLE works better)
char path[128];
int state;
- snprintf(path, 127, "/sys/block/%s/queue/protect", disk);
+ snprintf(path, 127, "/sys/block/%s/device/unload_heads", disk);
+ if (access(path, F_OK)) {
+ snprintf(path, 127, "/sys/block/%s/queue/protect", disk);
+ }
if ((fp = fopen(path, "r")) == NULL)
return "n/a ";
if (fscanf(fp, "%d\n", &state) != 1) {
return "failed";
}
fclose(fp);
- return state ? "frozen" : "free ";
+ return (state > 0) ? "frozen" : "free ";
}