From c9d3114663cd31f470909d06b9cfefee23b5762e Mon Sep 17 00:00:00 2001 From: phk Date: Thu, 15 May 2008 01:25:29 +0000 Subject: 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" --- sbin/atacontrol/atacontrol.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sbin') diff --git a/sbin/atacontrol/atacontrol.c b/sbin/atacontrol/atacontrol.c index 590b29c..030f825 100644 --- a/sbin/atacontrol/atacontrol.c +++ b/sbin/atacontrol/atacontrol.c @@ -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 ? " " : ""); -- cgit v1.1