summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Deval <tdeval@cvs.openbsd.org>2002-02-19 08:38:41 +0000
committerThierry Deval <tdeval@cvs.openbsd.org>2002-02-19 08:38:41 +0000
commit11436e656a3c9d01d4d8c8cb3552ba2106cf8efa (patch)
tree438ae9dea630bafa790d462e8437fcbd0d32a97a
parent316f8982fe28648c4cc7df868653f6e1a4501d40 (diff)
don't do anything if #raid=0 (just return)
-rw-r--r--sbin/raidctl/raidctl.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sbin/raidctl/raidctl.c b/sbin/raidctl/raidctl.c
index 36fde10644f..1fd33d5d100 100644
--- a/sbin/raidctl/raidctl.c
+++ b/sbin/raidctl/raidctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: raidctl.c,v 1.12 2002/02/19 02:21:30 deraadt Exp $ */
+/* $OpenBSD: raidctl.c,v 1.13 2002/02/19 08:38:40 tdeval Exp $ */
/* $NetBSD: raidctl.c,v 1.27 2001/07/10 01:30:52 lukem Exp $ */
/*-
@@ -243,7 +243,12 @@ main(argc, argv)
strlcpy(name, argv[0], PATH_MAX);
- nfd = open_device(&fds, name);
+ if ((nfd = open_device(&fds, name)) < 1) {
+ /* No configured raid device */
+ free(fds);
+ return (0);
+ }
+
if (do_all) {
switch(action) {
case RAIDFRAME_ADD_HOT_SPARE: