Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 254322
Collapse All | Expand All

(-)khdapsmonitor-0.1/src/sysfs.cpp.old (+7 lines)
Lines 63-68 Link Here
63
  {
63
  {
64
    if(QFile("/sys/block/" + deviceList[i] + "/queue/protect").exists())
64
    if(QFile("/sys/block/" + deviceList[i] + "/queue/protect").exists())
65
	i++;
65
	i++;
66
  // newer kernels provide a different interface
67
  else if (QFile("/sys/block/" + deviceList[i] + "/device/unload_heads").exists())
68
  i++;
66
    else
69
    else
67
        deviceList.remove(deviceList.at(i));
70
        deviceList.remove(deviceList.at(i));
68
  }
71
  }
Lines 71-75 Link Here
71
74
72
bool SysFS::queueProtected(QString device)
75
bool SysFS::queueProtected(QString device)
73
{
76
{
77
  // newer kernels provide a different interface
78
  if (QFile("/sys/block/" + device + "/device/unload_heads").exists())
79
  return fileBool("/sys/block/" + device + "/device/unload_heads");
80
  else
74
  return fileBool("/sys/block/" + device + "/queue/protect");
81
  return fileBool("/sys/block/" + device + "/queue/protect");
75
}
82
}

Return to bug 254322