From: krw Date: Thu, 10 Jun 2021 15:30:49 +0000 (+0000) Subject: Shift zeroing of gpt header and partition table to top of X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=4d692ca34d47a8e5d2d5c631c4042528f9ed9e30;p=openbsd Shift zeroing of gpt header and partition table to top of MBR_init() from middle of MBR partition flag tweaking. No functional change. --- diff --git a/sbin/fdisk/mbr.c b/sbin/fdisk/mbr.c index 41e7478d5ef..72382043e98 100644 --- a/sbin/fdisk/mbr.c +++ b/sbin/fdisk/mbr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mbr.c,v 1.74 2021/06/10 15:09:16 krw Exp $ */ +/* $OpenBSD: mbr.c,v 1.75 2021/06/10 15:30:49 krw Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -81,6 +81,9 @@ MBR_init(struct mbr *mbr) uint64_t adj; daddr_t daddr; + memset(&gh, 0, sizeof(gh)); + memset(&gp, 0, sizeof(gp)); + /* * XXX Do *NOT* zap all MBR parts! Some archs still read initmbr * from disk!! Just mark them inactive until -b goodness spreads @@ -90,9 +93,6 @@ MBR_init(struct mbr *mbr) mbr->part[1].flag = 0; mbr->part[2].flag = 0; - memset(&gh, 0, sizeof(gh)); - memset(&gp, 0, sizeof(gp)); - mbr->part[3].flag = DOSACTIVE; mbr->signature = DOSMBR_SIGNATURE;