summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2010-01-22 21:56:05 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2010-01-22 21:56:05 +0000
commit9a45a0ce6c6d035afb84a39b37702c5d2181580e (patch)
tree9921f2b4eb6894fdbae7cf801b1380ceaee83c04 /sys
parent290dbbfd0c42edad053dfe7884638dde38591649 (diff)
Correctly return ENXIO on unhandled ioctls; ok marco@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/bio.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/dev/bio.c b/sys/dev/bio.c
index b867fcde3b6..a3bfdca67cb 100644
--- a/sys/dev/bio.c
+++ b/sys/dev/bio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bio.c,v 1.11 2007/12/23 17:09:49 deraadt Exp $ */
+/* $OpenBSD: bio.c,v 1.12 2010/01/22 21:56:04 miod Exp $ */
/*
* Copyright (c) 2002 Niklas Hallqvist. All rights reserved.
@@ -88,12 +88,23 @@ bioioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
return (ENOENT);
break;
- default:
+ case BIOCINQ:
+ case BIOCDISK:
+ case BIOCVOL:
+ case BIOCALARM:
+ case BIOCBLINK:
+ case BIOCSETSTATE:
+ case BIOCCREATERAID:
+ case BIOCDELETERAID:
+ case BIOCDISCIPLINE:
common = (struct bio_common *)addr;
if (!bio_validate(common->bc_cookie))
return (ENOENT);
return (bio_delegate_ioctl(
(struct bio_mapping *)common->bc_cookie, cmd, addr));
+
+ default:
+ return (ENXIO);
}
return (0);
}