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:
phk 2008-05-15 01:25:29 +00:00
parent 246edbe9f2
commit c9d3114663

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 ? " " : "");