summaryrefslogtreecommitdiff
path: root/sbin/bioctl/bioctl.c
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2009-07-31 16:12:11 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2009-07-31 16:12:11 +0000
commit1b4d91db9fae2164f96cde47bfd8ff820ee7d4bb (patch)
tree37a125515fae9910ae397e0c8f3373627c5c8bc7 /sbin/bioctl/bioctl.c
parentfc341189735156b1b3804c4a4648eeb9abdbd766 (diff)
Allow hotspares to be added to bio devices rather than requiring an sd
device. "Yeah!" marco@
Diffstat (limited to 'sbin/bioctl/bioctl.c')
-rw-r--r--sbin/bioctl/bioctl.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sbin/bioctl/bioctl.c b/sbin/bioctl/bioctl.c
index 7c31b62a99e..034167baaf6 100644
--- a/sbin/bioctl/bioctl.c
+++ b/sbin/bioctl/bioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bioctl.c,v 1.80 2009/06/18 08:05:51 halex Exp $ */
+/* $OpenBSD: bioctl.c,v 1.81 2009/07/31 16:12:10 jsing Exp $ */
/*
* Copyright (c) 2004, 2005 Marco Peereboom
@@ -562,10 +562,12 @@ bio_setstate(char *arg, int status, char *devicename)
bs.bs_cookie = bl.bl_cookie;
bs.bs_status = status;
- /* make sure user supplied a sd device */
- bs.bs_volid = bio_getvolbyname(devicename);
- if (bs.bs_volid == -1)
- errx(1, "invalid device %s", devicename);
+ if (status != BIOC_SSHOTSPARE) {
+ /* make sure user supplied a sd device */
+ bs.bs_volid = bio_getvolbyname(devicename);
+ if (bs.bs_volid == -1)
+ errx(1, "invalid device %s", devicename);
+ }
rv = ioctl(devh, BIOCSETSTATE, &bs);
if (rv == -1)