From 75bd4c1549d9714f555553003182129c97304a5f Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Thu, 7 Nov 2002 14:39:21 +0000 Subject: Get this closer to working. The Write_Disk() function's for loop needed to use the same start condition as the i386 version. However, since Alpha's only have one fake "slice" from sysinstall's perspective we don't need to use a loop, but can just write out the BSD label in the first fake "slice". --- lib/libdisk/write_alpha_disk.c | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) (limited to 'lib/libdisk/write_alpha_disk.c') diff --git a/lib/libdisk/write_alpha_disk.c b/lib/libdisk/write_alpha_disk.c index 5cbdecf491f7..c2e18e7286a6 100644 --- a/lib/libdisk/write_alpha_disk.c +++ b/lib/libdisk/write_alpha_disk.c @@ -67,33 +67,26 @@ Write_FreeBSD(int fd, const struct disk *new, const struct disk *old, const stru return 0; } - - int Write_Disk(const struct disk *d1) { - int fd; - struct disk *old = NULL; - struct chunk *c1; - int ret = 0; char device[64]; + struct chunk *c1; + int fd, ret; - strcpy(device,_PATH_DEV); - strcat(device,d1->name); - - - fd = open(device,O_RDWR); - if (fd < 0) - return 1; + strcpy(device, _PATH_DEV); + strcat(device, d1->name); - for (c1 = d1->chunks->part->part; c1; c1 = c1->next) { - if (c1->type == unused) continue; - if (!strcmp(c1->name, "X")) continue; - if (c1->type == freebsd) - ret += Write_FreeBSD(fd, d1, old, c1); + fd = open(device,O_RDWR); + if (fd < 0) + return (1); - } + c1 = d1->chunks->part; + if (!strcmp(c1->name, "X") || c1->type != freebsd) + ret = 0; + else + ret = Write_FreeBSD(fd, d1, NULL, c1); close(fd); - return 0; + return (ret); } -- cgit v1.3