Fix for a bug I introduced when I cleaned up atacontrol: Don't terminate

if we are listing devices, a controller might legitimately not be there.

Submitted by:	"Andrey V. Elsukov" <bu7cher@yandex.ru>
This commit is contained in:
Poul-Henning Kamp
2008-05-15 01:25:29 +00:00
parent 338c585e38
commit 8680fabaa8
+5 -3
View File
@@ -265,9 +265,11 @@ info_print(int fd, int channel, int prchan)
devices.channel = channel;
if (ioctl(fd, IOCATADEVICES, &devices) < 0)
err(1, "ioctl(IOCATADEVICES)");
if (ioctl(fd, IOCATADEVICES, &devices) < 0) {
if (!prchan)
err(1, "ioctl(IOCATADEVICES)");
return;
}
if (prchan)
printf("ATA channel %d:\n", channel);
printf("%sMaster: ", prchan ? " " : "");