From 10df2990d89693dbdfd2fc4b4a646e54368d59ca Mon Sep 17 00:00:00 2001 From: cgd Date: Sun, 19 Mar 1995 23:37:56 +0000 Subject: re-order the DIOCWLABEL in the rflag case, so it actually works right. --- sbin/disklabel/disklabel.c | 12 +++++++----- 1 file 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; -- cgit