aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>1994-11-08 10:14:19 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>1994-11-08 10:14:19 +0000
commit46c134684cd4c2b2732f175466e11d80dada2bb3 (patch)
tree0be1a23291f7747ad9a361108aad1f99f58c7f1d
parentd32d339dc6dccfd455f6cab59958bbc041efbc68 (diff)
downloadsrc-46c134684cd4c2b2732f175466e11d80dada2bb3.tar.gz
src-46c134684cd4c2b2732f175466e11d80dada2bb3.zip
Always say the magic word at the end.
Notes
Notes: svn path=/head/; revision=4267
-rw-r--r--sbin/sysinstall/mbr.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sbin/sysinstall/mbr.c b/sbin/sysinstall/mbr.c
index bf841ffda19b..5ba973b0958b 100644
--- a/sbin/sysinstall/mbr.c
+++ b/sbin/sysinstall/mbr.c
@@ -67,23 +67,21 @@ void
write_dospart(int fd, struct dos_partition *dp)
{
u_char buf[512];
- int flag;
+
if (lseek(fd, 0, SEEK_SET) == -1)
AskAbort("Couldn't seek for master boot record read\n");
if (read(fd, buf, 512) != 512) {
AskAbort("Failed to read master boot record\n");
}
memcpy(buf+DOSPARTOFF, dp, sizeof(*dp)*NDOSPART);
+ buf[510] = 0x55;
+ buf[511] = 0xaa;
if (lseek(fd, 0, SEEK_SET) == -1)
- AskAbort("Couldn't seek for master boot record read\n");
- flag=1;
- if (ioctl(fd, DIOCWLABEL, &flag) < 0)
- AskAbort("Couldn't enable writing of labels");
+ AskAbort("Couldn't seek for master boot record write\n");
+ enable_label(fd);
if (write(fd, buf, 512) != 512)
AskAbort("Failed to write master boot record\n");
- flag=0;
- if (ioctl(fd, DIOCWLABEL, &flag) < 0)
- AskAbort("Couldn't disable writing of labels");
+ disable_label(fd);
}
int