summaryrefslogtreecommitdiff
path: root/lib/libdisk/create_chunk.c
diff options
context:
space:
mode:
authorPeter Grehan <grehan@FreeBSD.org>2004-04-21 23:21:13 +0000
committerPeter Grehan <grehan@FreeBSD.org>2004-04-21 23:21:13 +0000
commitacc2f44a41cf520cb845155706c85afbf43c49a8 (patch)
tree424d360a1d9752b9b11b6336dd2e237be1c2f8ca /lib/libdisk/create_chunk.c
parent7f89270bad8f5366edecefebd5a546069e47c001 (diff)
Notes
Diffstat (limited to 'lib/libdisk/create_chunk.c')
-rw-r--r--lib/libdisk/create_chunk.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/lib/libdisk/create_chunk.c b/lib/libdisk/create_chunk.c
index c65b8f3f3390..3d498a6652d3 100644
--- a/lib/libdisk/create_chunk.c
+++ b/lib/libdisk/create_chunk.c
@@ -134,6 +134,24 @@ Fixup_Extended_Names(struct chunk *c)
}
#endif
+#ifdef __powerpc__
+static int
+Fixup_Apple_Names(struct chunk *c)
+{
+ struct chunk *c1;
+
+ for (c1 = c->part; c1; c1 = c1->next) {
+ if (c1->type == unused)
+ continue;
+ free(c1->name);
+ c1->name = strdup(c->name);
+ if (!c1->name)
+ return (-1);
+ }
+ return 0;
+}
+#endif
+
int
Fixup_Names(struct disk *d)
{
@@ -185,6 +203,10 @@ Fixup_Names(struct disk *d)
for (c2 = c1->part; c2; c2 = c2->next) {
if (c2->type == freebsd)
Fixup_FreeBSD_Names(c2);
+#ifdef __powerpc__
+ else if (c2->type == apple)
+ Fixup_Apple_Names(c2);
+#endif
#ifndef PC98
else if (c2->type == extended)
Fixup_Extended_Names(c2);
@@ -238,7 +260,8 @@ Create_Chunk_DWIM(struct disk *d, struct chunk *parent, daddr_t size,
if (!parent)
parent = d->chunks;
- if (parent->type == freebsd && type == part && parent->part == NULL) {
+ if ((parent->type == freebsd && type == part && parent->part == NULL)
+ || (parent->type == apple && type == part && parent->part == NULL)) {
c1 = New_Chunk();
if (c1 == NULL)
return (NULL);