From 54f445fb695088b4e11441e3a2ef14fd06923dc1 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Fri, 9 May 2003 19:07:59 +0000 Subject: [PATCH] Sigh, this shows just how much one can be conditioned my the environment: Just because we for the last ten years have fought for every byte in the boot code on i386, doesn't mean that other architectures could not actually have space to spare there. Remore debugging message. --- sbin/bsdlabel/bsdlabel.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c index 4c77a3557f36..9597fe572d49 100644 --- a/sbin/bsdlabel/bsdlabel.c +++ b/sbin/bsdlabel/bsdlabel.c @@ -308,18 +308,17 @@ readboot(void) if (fd < 0) err(1, "cannot open %s", xxboot); fstat(fd, &st); - if (st.st_size == BBSIZE) { - i = read(fd, bootarea, BBSIZE); - if (i != BBSIZE) + if (alphacksum && st.st_size <= BBSIZE - 512) { + i = read(fd, bootarea + 512, st.st_size); + if (i != st.st_size) + err(1, "read error %s", xxboot); + return; + } else if ((!alphacksum) && st.st_size <= BBSIZE) { + i = read(fd, bootarea, st.st_size); + if (i != st.st_size) err(1, "read error %s", xxboot); return; } - if (alphacksum && st.st_size == BBSIZE - 512) { - i = read(fd, bootarea + 512, BBSIZE - 512); - if (i != BBSIZE - 512) - err(1, "read error %s", xxboot); - return; - } errx(1, "boot code %s is wrong size", xxboot); } @@ -424,7 +423,6 @@ readlabel(int flag) gctl_rw_param(grq, "mbroffset", sizeof(mbroffset), &mbroffset); errstr = gctl_issue(grq); if (errstr != NULL) { - warnx("%s", errstr); mbroffset = 0; gctl_free(grq); return (error);