summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2009-07-31 16:12:10 +0000
committerjsing <jsing@openbsd.org>2009-07-31 16:12:10 +0000
commitd2647ac189d4a649c011c511345a977b511e9a64 (patch)
tree5bc7e281cac3cb432b35ce3721595485d7772f55
parentFactor out code for checking if a chunk is already in use. (diff)
downloadwireguard-openbsd-d2647ac189d4a649c011c511345a977b511e9a64.tar.xz
wireguard-openbsd-d2647ac189d4a649c011c511345a977b511e9a64.zip
Allow hotspares to be added to bio devices rather than requiring an sd
device. "Yeah!" marco@
-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)