From 8680fabaa81f853587d1e67ca237b3474ed5c37e Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Thu, 15 May 2008 01:25:29 +0000 Subject: [PATCH] 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(-) diff --git a/sbin/atacontrol/atacontrol.c b/sbin/atacontrol/atacontrol.c index 590b29cfc8a..030f82566b7 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 ? " " : "");