summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2008-05-15 01:25:29 +0000
committerphk <phk@FreeBSD.org>2008-05-15 01:25:29 +0000
commitc9d3114663cd31f470909d06b9cfefee23b5762e (patch)
tree917b54f47ffbf205d773917bfa20bccef63e0848 /sbin
parent246edbe9f22c044d4632b820cd586923803901f9 (diff)
downloadFreeBSD-src-c9d3114663cd31f470909d06b9cfefee23b5762e.zip
FreeBSD-src-c9d3114663cd31f470909d06b9cfefee23b5762e.tar.gz
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>
Diffstat (limited to 'sbin')
-rw-r--r--sbin/atacontrol/atacontrol.c8
1 files changed, 5 insertions, 3 deletions
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 ? " " : "");
OpenPOWER on IntegriCloud