| @@ 180-186 (lines=7) @@ | ||
| 177 | if (preg_match('/^hd/', $file)) { |
|
| 178 | $dev = new HWDevice(); |
|
| 179 | $dev->setName(trim($file)); |
|
| 180 | if (CommonFunctions::rfts("/proc/ide/".$file."/media", $buf, 1)) { |
|
| 181 | if (trim($buf) == 'disk') { |
|
| 182 | if (CommonFunctions::rfts("/proc/ide/".$file."/capacity", $buf, 1, 4096, false)) { |
|
| 183 | $dev->setCapacity(trim($buf) * 512 / 1024); |
|
| 184 | } |
|
| 185 | } |
|
| 186 | } |
|
| 187 | $this->sys->setIdeDevices($dev); |
|
| 188 | } |
|
| 189 | } |
|
| @@ 461-465 (lines=5) @@ | ||
| 458 | $dev = new HWDevice(); |
|
| 459 | $dev->setName(trim($file)); |
|
| 460 | if (CommonFunctions::rfts("/proc/ide/".$file."/media", $buf, 1)) { |
|
| 461 | if (trim($buf) == 'disk') { |
|
| 462 | if (CommonFunctions::rfts("/proc/ide/".$file."/capacity", $buf, 1, 4096, false) || CommonFunctions::rfts("/sys/block/".$file."/size", $buf, 1, 4096, false)) { |
|
| 463 | $dev->setCapacity(trim($buf) * 512 / 1024); |
|
| 464 | } |
|
| 465 | } |
|
| 466 | } |
|
| 467 | if (CommonFunctions::rfts("/proc/ide/".$file."/model", $buf, 1)) { |
|
| 468 | $dev->setName($dev->getName().": ".trim($buf)); |
|