diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2009-09-05 00:48:40 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2009-09-05 00:48:40 +0000 |
commit | fce0339e25d60b70523c3fd6ca778dff89e93720 (patch) | |
tree | 37a2e8f87296691dad5043704e04d2c61f6377de /sys/arch/vax/mba | |
parent | fc28b8935aa496ce905d6b41cd4f1e1f5fd33064 (diff) |
Make DIOCSDINFO code consistant everywhere.
ok miod@ deraadt@
Diffstat (limited to 'sys/arch/vax/mba')
-rw-r--r-- | sys/arch/vax/mba/hp.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/sys/arch/vax/mba/hp.c b/sys/arch/vax/mba/hp.c index 391f6fd96fe..088213e60cc 100644 --- a/sys/arch/vax/mba/hp.c +++ b/sys/arch/vax/mba/hp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hp.c,v 1.19 2007/09/01 12:45:42 miod Exp $ */ +/* $OpenBSD: hp.c,v 1.20 2009/09/05 00:48:39 krw Exp $ */ /* $NetBSD: hp.c,v 1.22 2000/02/12 16:09:33 ragge Exp $ */ /* * Copyright (c) 1996 Ludd, University of Lule}, Sweden. @@ -338,19 +338,18 @@ hpioctl(dev, cmd, addr, flag, p) &lp->d_partitions[DISKPART(dev)]; break; + case DIOCWDINFO: case DIOCSDINFO: if ((flag & FWRITE) == 0) return EBADF; - return setdisklabel(lp, (struct disklabel *)addr, 0, 0); - - case DIOCWDINFO: - if ((flag & FWRITE) == 0) - error = EBADF; - else { - sc->sc_wlabel = 1; - error = writedisklabel(dev, hpstrategy, lp, 0); - sc->sc_wlabel = 0; + error = setdisklabel(lp, (struct disklabel *)addr, 0); + if (error == 0) { + if (cmd == DIOCWDINFO) { + sc->sc_wlabel = 1; + error = writedisklabel(dev, hpstrategy, lp, 0); + sc->sc_wlabel = 0; + } } return error; case DIOCWLABEL: |