From 589a66af41f445f6030a2aa432ca038ea578d70d Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Mon, 18 Jun 2007 07:09:26 +0000 Subject: simplify error return case from writedisklabel() --- sys/arch/landisk/landisk/disksubr.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'sys/arch/landisk') diff --git a/sys/arch/landisk/landisk/disksubr.c b/sys/arch/landisk/landisk/disksubr.c index b81d23e8b83..e99738d3ead 100644 --- a/sys/arch/landisk/landisk/disksubr.c +++ b/sys/arch/landisk/landisk/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.34 2007/06/18 05:25:07 deraadt Exp $ */ +/* $OpenBSD: disksubr.c,v 1.35 2007/06/18 07:09:25 deraadt Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -101,7 +101,7 @@ int writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp, struct cpu_disklabel *osdep) { - int error, partoff = -1, cyl = 0; + int error = EIO, partoff = -1, cyl = 0; struct disklabel *dlp; struct buf *bp = NULL; @@ -109,10 +109,8 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), bp = geteblk((int)lp->d_secsize); bp->b_dev = dev; - if (readdoslabel(bp, strat, lp, osdep, &partoff, &cyl, 1) != NULL) { - error = EIO; + if (readdoslabel(bp, strat, lp, osdep, &partoff, &cyl, 1) != NULL) goto done; - } /* Read it in, slap the new label in, and write it back out */ bp->b_blkno = partoff + LABELSECTOR; -- cgit v1.2.3