summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2015-12-24 18:03:04 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2015-12-24 18:03:04 +0000
commitb7c254243fdfd92e3402e3fe0568c409bef9b629 (patch)
tree9b9ce25150b9fd86ee19b66b461c9be62b970729 /usr.sbin
parent4786a6bbe424bd70c070ca2f37c67c811ff947c1 (diff)
Make all instances of gpt_chk_mbr() identical (bar static vs
non-static) by passing disk size as 2nd parameter instead of the different structures holding the disk size info. The fifth copy of gpt_chk_mbr() in fdisk is a little specialer. No functional change.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/installboot/i386_installboot.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/usr.sbin/installboot/i386_installboot.c b/usr.sbin/installboot/i386_installboot.c
index 933e25a4df7..b789abc911d 100644
--- a/usr.sbin/installboot/i386_installboot.c
+++ b/usr.sbin/installboot/i386_installboot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i386_installboot.c,v 1.23 2015/12/24 14:12:43 krw Exp $ */
+/* $OpenBSD: i386_installboot.c,v 1.24 2015/12/24 18:03:03 krw Exp $ */
/* $NetBSD: installboot.c,v 1.5 1995/11/17 23:23:50 gwr Exp $ */
/*
@@ -90,7 +90,7 @@ static void devread(int, void *, daddr_t, size_t, char *);
static u_int findopenbsd(int, struct disklabel *);
static int getbootparams(char *, int, struct disklabel *);
static char *loadproto(char *, long *);
-static int gpt_chk_mbr(struct dos_partition *, struct disklabel *);
+static int gpt_chk_mbr(struct dos_partition *, u_int64_t);
/*
* Read information about /boot's inode and filesystem parameters, then
@@ -456,10 +456,9 @@ again:
* NOTE: MS always uses a size of UINT32_MAX for the EFI partition!**
*/
static int
-gpt_chk_mbr(struct dos_partition *dp, struct disklabel *lp)
+gpt_chk_mbr(struct dos_partition *dp, u_int64_t dsize)
{
struct dos_partition *dp2;
- u_int64_t dsize;
int efi, found, i;
u_int32_t psize;
@@ -470,7 +469,6 @@ gpt_chk_mbr(struct dos_partition *dp, struct disklabel *lp)
found++;
if (dp2->dp_typ != DOSPTYP_EFI)
continue;
- dsize = DL_GETDSIZE(lp);
psize = letoh32(dp2->dp_size);
if (psize == (dsize - 1) ||
psize == UINT32_MAX) {
@@ -511,7 +509,7 @@ findgptefisys(int devfd, struct disklabel *dl)
if (len != dl->d_secsize)
err(4, "can't read mbr");
memcpy(dp, &secbuf[DOSPARTOFF], sizeof(dp));
- if (gpt_chk_mbr(dp, dl)) {
+ if (gpt_chk_mbr(dp, DL_GETDSIZE(dl))) {
free(secbuf);
return (-1);
}