diff options
author | phk <phk@FreeBSD.org> | 2003-05-09 19:07:59 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-05-09 19:07:59 +0000 |
commit | 769c145dbe2523d1a6a3743d69cb46a8b3b22ece (patch) | |
tree | 9b3f39fe85b5afc99002abaaf1ed20ef03e1d48a /sbin | |
parent | 31356c64a85c099318415ca5479ed30f778f207c (diff) | |
download | FreeBSD-src-769c145dbe2523d1a6a3743d69cb46a8b3b22ece.zip FreeBSD-src-769c145dbe2523d1a6a3743d69cb46a8b3b22ece.tar.gz |
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.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/bsdlabel/bsdlabel.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c index 4c77a35..9597fe5 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; - } - if (alphacksum && st.st_size == BBSIZE - 512) { - i = read(fd, bootarea + 512, BBSIZE - 512); - if (i != BBSIZE - 512) + } 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; - } + } 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); |