summaryrefslogtreecommitdiff
path: root/sys/dev/ld.c
diff options
context:
space:
mode:
authortron <tron@NetBSD.org>2007-04-30 17:23:09 +0000
committertron <tron@NetBSD.org>2007-04-30 17:23:09 +0000
commitc021b87a9d811be41926bc19f2184fdaff895965 (patch)
treec61345370e24e1241a037edf88df433a62f464ab /sys/dev/ld.c
parent2ad855f76d349639fb9f9150618e4b0aa43fa064 (diff)
Reset error code if an ioctl() request is not handled by the generic
disk framework. This stops ld(4) from returning an error for various ioctl() requests which actually *did* work. As a result fdisk(8) and therefore also sysinst(8) work with ld(4) devices once again. Based on a patch supplied by Todd Kover in PR kern/36244, successfully tested with ld(4)@icp(4).
Diffstat (limited to 'sys/dev/ld.c')
-rw-r--r--sys/dev/ld.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/ld.c b/sys/dev/ld.c
index c94e4a11718..e08457f6c81 100644
--- a/sys/dev/ld.c
+++ b/sys/dev/ld.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ld.c,v 1.46 2007/03/04 06:01:42 christos Exp $ */
+/* $NetBSD: ld.c,v 1.47 2007/04/30 17:23:09 tron Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.46 2007/03/04 06:01:42 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.47 2007/04/30 17:23:09 tron Exp $");
#include "rnd.h"
@@ -396,12 +396,12 @@ ldioctl(dev_t dev, u_long cmd, void *addr, int32_t flag, struct lwp *l)
unit = DISKUNIT(dev);
part = DISKPART(dev);
sc = device_lookup(&ld_cd, unit);
- error = 0;
error = disk_ioctl(&sc->sc_dk, cmd, addr, flag, l);
if (error != EPASSTHROUGH)
return (error);
+ error = 0;
switch (cmd) {
case DIOCGDINFO:
memcpy(addr, sc->sc_dk.dk_label, sizeof(struct disklabel));