summaryrefslogtreecommitdiff
path: root/sbin/disklabel
diff options
context:
space:
mode:
authorcgd <cgd@NetBSD.org>1995-03-19 23:37:56 +0000
committercgd <cgd@NetBSD.org>1995-03-19 23:37:56 +0000
commit10df2990d89693dbdfd2fc4b4a646e54368d59ca (patch)
treebe821405e832ebb05f07f39bbb364b2e7667920c /sbin/disklabel
parent20a403a2921040b2400c37d885fc5dae75b7a441 (diff)
re-order the DIOCWLABEL in the rflag case, so it actually works right.
Diffstat (limited to 'sbin/disklabel')
-rw-r--r--sbin/disklabel/disklabel.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c
index a809b89f30d..50c8537408d 100644
--- a/sbin/disklabel/disklabel.c
+++ b/sbin/disklabel/disklabel.c
@@ -1,4 +1,4 @@
-/* $NetBSD: disklabel.c,v 1.23 1995/03/18 14:54:40 cgd Exp $ */
+/* $NetBSD: disklabel.c,v 1.24 1995/03/19 23:37:56 cgd Exp $ */
/*
* Copyright (c) 1987, 1993
@@ -47,7 +47,7 @@ static char copyright[] =
/* from static char sccsid[] = "@(#)disklabel.c 1.2 (Symmetric) 11/28/85"; */
static char sccsid[] = "@(#)disklabel.c 8.2 (Berkeley) 1/7/94";
#else
-static char rcsid[] = "$NetBSD: disklabel.c,v 1.23 1995/03/18 14:54:40 cgd Exp $";
+static char rcsid[] = "$NetBSD: disklabel.c,v 1.24 1995/03/19 23:37:56 cgd Exp $";
#endif
#endif /* not lint */
@@ -459,14 +459,16 @@ writelabel(f, boot, lp)
return(1);
}
#endif
- writeable = 0;
- if (ioctl(f, DIOCWLABEL, &writeable) < 0)
- perror("ioctl DIOCWLABEL");
}
if (ioctl(f, DIOCWDINFO, lp) < 0) {
l_perror("ioctl DIOCWDINFO");
return (1);
}
+ if (rflag) {
+ writeable = 0;
+ if (ioctl(f, DIOCWLABEL, &writeable) < 0)
+ perror("ioctl DIOCWLABEL");
+ }
#ifdef vax
if (lp->d_type == DTYPE_SMD && lp->d_flags & D_BADSECT) {
daddr_t alt;