diff options
author | 2009-07-31 16:12:10 +0000 | |
---|---|---|
committer | 2009-07-31 16:12:10 +0000 | |
commit | d2647ac189d4a649c011c511345a977b511e9a64 (patch) | |
tree | 5bc7e281cac3cb432b35ce3721595485d7772f55 | |
parent | Factor out code for checking if a chunk is already in use. (diff) | |
download | wireguard-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.c | 12 |
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) |