diff options
author | 2008-06-14 18:40:50 +0000 | |
---|---|---|
committer | 2008-06-14 18:40:50 +0000 | |
commit | 83e979ed13e205fde0d6ff4981e3d1388001c09d (patch) | |
tree | f864f4eac8ffb1be1f46fdec44df094c0d6c4e3d /sys/dev/softraid.c | |
parent | suppress the warning message from chdir(homedir) failures (diff) | |
download | wireguard-openbsd-83e979ed13e205fde0d6ff4981e3d1388001c09d.tar.xz wireguard-openbsd-83e979ed13e205fde0d6ff4981e3d1388001c09d.zip |
Provide a status field for operations on the bc_opaque data. Now we're
able to distinguish cleanly an failing ioctl (ie. return value -1) from
trying to retrieve a KDF hint from a not yet initialized volume.
ok marco djm
Diffstat (limited to 'sys/dev/softraid.c')
-rw-r--r-- | sys/dev/softraid.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index 6243a8be7bb..eec9eaaffdb 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.114 2008/06/14 00:16:38 hshoexer Exp $ */ +/* $OpenBSD: softraid.c,v 1.115 2008/06/14 18:40:50 hshoexer Exp $ */ /* * Copyright (c) 2007 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org> @@ -827,6 +827,13 @@ sr_ioctl_createraid(struct sr_softc *sc, struct bioc_createraid *bc, int user) if (no_chunk != 1) goto unwind; + /* no hint available yet */ + if (bc->bc_opaque_flags & BIOC_SOOUT) { + bc->bc_opaque_status = BIOC_SOINOUT_FAILED; + rv = 0; + goto unwind; + } + if (!(bc->bc_flags & BIOC_SCNOAUTOASSEMBLE)) goto unwind; @@ -891,6 +898,7 @@ sr_ioctl_createraid(struct sr_softc *sc, struct bioc_createraid *bc, int user) goto unwind; /* we're done */ + bc->bc_opaque_status = BIOC_SOINOUT_OK; rv = 0; goto unwind; } |