summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/dev
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2009-09-12 01:23:31 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2009-09-12 01:23:31 +0000
commit1d997662ca3b9e7cb9c0e8628c00102475b71844 (patch)
tree5860b1fd08e639bbe0a7f2a896cdd36f2b4238cc /sys/arch/sparc/dev
parentfaa3c58abef04cbdb3ad14e386f4106925e94e1d (diff)
Add DIOCSDINFO support to the three fd drivers. No change to existing
behaviour.
Diffstat (limited to 'sys/arch/sparc/dev')
-rw-r--r--sys/arch/sparc/dev/fd.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/arch/sparc/dev/fd.c b/sys/arch/sparc/dev/fd.c
index 83124fddde7..7a33dd41d06 100644
--- a/sys/arch/sparc/dev/fd.c
+++ b/sys/arch/sparc/dev/fd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fd.c,v 1.67 2009/08/24 08:52:13 jasper Exp $ */
+/* $OpenBSD: fd.c,v 1.68 2009/09/12 01:23:30 krw Exp $ */
/* $NetBSD: fd.c,v 1.51 1997/05/24 20:16:19 pk Exp $ */
/*-
@@ -1771,16 +1771,17 @@ fdioctl(dev, cmd, addr, flag, p)
return (0);
case DIOCWDINFO:
+ case DIOCSDINFO:
if ((flag & FWRITE) == 0)
return (EBADF);
error = setdisklabel(fd->sc_dk.dk_label,
(struct disklabel *)addr, 0);
- if (error)
- return (error);
-
- error = writedisklabel(DISKLABELDEV(dev), fdstrategy,
- fd->sc_dk.dk_label);
+ if (error == 0) {
+ if (cmd == DIOCWDINFO)
+ error = writedisklabel(DISKLABELDEV(dev),
+ fdstrategy, fd->sc_dk.dk_label);
+ }
return (error);
case DIOCLOCK: