summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2015-03-19 22:48:58 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2015-03-19 22:48:58 +0000
commitdffee829e88c5a4510cd98e45d03993b694f842c (patch)
tree1b75afb6380be38712c426e03a3db8bf693c378f
parent6addc8d396413dbaadfa08fdaf93c00e2783b991 (diff)
When zapping the GPT at the end of the disk, don't use disk.size
to get the location. disk.size is a 32 bit value for MBR use. Use DL_GETDSIZE(&dl) to get the real location even on 'big' disks.
-rw-r--r--sbin/fdisk/cmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/fdisk/cmd.c b/sbin/fdisk/cmd.c
index 5821e1201fe..fc9fa34d30e 100644
--- a/sbin/fdisk/cmd.c
+++ b/sbin/fdisk/cmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd.c,v 1.78 2015/03/18 14:46:59 krw Exp $ */
+/* $OpenBSD: cmd.c,v 1.79 2015/03/19 22:48:57 krw Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
@@ -295,7 +295,7 @@ Xwrite(char *args, struct mbr *mbr)
/* Make sure GPT doesn't get in the way. */
if (reinited)
- MBR_zapgpt(fd, &dos_mbr, disk.size - 1);
+ MBR_zapgpt(fd, &dos_mbr, DL_GETDSIZE(&dl) - 1);
/* Refresh in memory copy to reflect what was just written. */
MBR_parse(&dos_mbr, mbr->offset, mbr->reloffset, mbr);