From 3ea7aedd41bba65f240ad573ebcb89b82436b49c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Schmidt?= Date: Fri, 5 Aug 2005 13:08:02 +0000 Subject: [PATCH] Fix status to report status from the given array. --- sbin/atacontrol/atacontrol.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sbin/atacontrol/atacontrol.c b/sbin/atacontrol/atacontrol.c index 2e263971a700..20698cd0cd77 100644 --- a/sbin/atacontrol/atacontrol.c +++ b/sbin/atacontrol/atacontrol.c @@ -477,7 +477,7 @@ main(int argc, char **argv) if (!(sscanf(argv[2], "ar%d", &array) == 1)) { fprintf(stderr, - "atacontrol: Invalid array %s\n", argv[3]); + "atacontrol: Invalid array %s\n", argv[2]); exit(EX_USAGE); } if (ioctl(fd, IOCATARAIDDELETE, &array) < 0) @@ -489,7 +489,7 @@ main(int argc, char **argv) if (!(sscanf(argv[2], "ar%d", &config.lun) == 1)) { fprintf(stderr, - "atacontrol: Invalid array %s\n", argv[3]); + "atacontrol: Invalid array %s\n", argv[2]); usage(); } if (!(sscanf(argv[3], "ad%d", &config.disks[0]) == 1)) { @@ -506,7 +506,7 @@ main(int argc, char **argv) if (!(sscanf(argv[2], "ar%d", &array) == 1)) { fprintf(stderr, - "atacontrol: Invalid array %s\n", argv[3]); + "atacontrol: Invalid array %s\n", argv[2]); usage(); } if (ioctl(fd, IOCATARAIDREBUILD, &array) < 0) @@ -525,6 +525,11 @@ main(int argc, char **argv) struct ata_ioc_raid_config config; int i; + if (!(sscanf(argv[2], "ar%d", &config.lun) == 1)) { + fprintf(stderr, + "atacontrol: Invalid array %s\n", argv[2]); + usage(); + } if (ioctl(fd, IOCATARAIDSTATUS, &config) < 0) err(1, "ioctl(IOCATARAIDSTATUS)");