diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2009-09-12 01:23:31 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2009-09-12 01:23:31 +0000 |
commit | 1d997662ca3b9e7cb9c0e8628c00102475b71844 (patch) | |
tree | 5860b1fd08e639bbe0a7f2a896cdd36f2b4238cc /sys/dev/isa | |
parent | faa3c58abef04cbdb3ad14e386f4106925e94e1d (diff) |
Add DIOCSDINFO support to the three fd drivers. No change to existing
behaviour.
Diffstat (limited to 'sys/dev/isa')
-rw-r--r-- | sys/dev/isa/fd.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/dev/isa/fd.c b/sys/dev/isa/fd.c index 40a7ce7cc0d..95063c927ee 100644 --- a/sys/dev/isa/fd.c +++ b/sys/dev/isa/fd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fd.c,v 1.82 2009/09/06 20:32:01 krw Exp $ */ +/* $OpenBSD: fd.c,v 1.83 2009/09/12 01:23:30 krw Exp $ */ /* $NetBSD: fd.c,v 1.90 1996/05/12 23:12:03 mycroft Exp $ */ /*- @@ -1059,15 +1059,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); + error = setdisklabel(fd->sc_dk.dk_label, + (struct disklabel *)addr, 0); + if (error == 0) { + if (cmd == DIOCWDINFO) + error = writedisklabel(DISKLABELDEV(dev), + fdstrategy, fd->sc_dk.dk_label); + } return error; case FD_FORM: |