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".
This commit is contained in:
John Baldwin 2002-11-07 14:39:21 +00:00
parent 7ea6c648f5
commit 75bd4c1549

View File

@ -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);
strcpy(device, _PATH_DEV);
strcat(device, d1->name);
fd = open(device,O_RDWR);
if (fd < 0)
return (1);
fd = open(device,O_RDWR);
if (fd < 0)
return 1;
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);
}
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);
}