diff options
author | jhb <jhb@FreeBSD.org> | 2002-11-07 14:39:21 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2002-11-07 14:39:21 +0000 |
commit | 2b9783b539782804413026ab116195ec2d17ba59 (patch) | |
tree | 28e4f53044afee46c3814805e84ed8d5cea8325e /lib/libdisk/write_alpha_disk.c | |
parent | 5b5c30694e530b845e110c1d5705183382cc9823 (diff) | |
download | FreeBSD-src-2b9783b539782804413026ab116195ec2d17ba59.zip FreeBSD-src-2b9783b539782804413026ab116195ec2d17ba59.tar.gz |
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".
Diffstat (limited to 'lib/libdisk/write_alpha_disk.c')
-rw-r--r-- | lib/libdisk/write_alpha_disk.c | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/lib/libdisk/write_alpha_disk.c b/lib/libdisk/write_alpha_disk.c index 5cbdecf..c2e18e7 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); } |