summaryrefslogtreecommitdiffstats
path: root/sys/geom/part
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2007-06-06 05:06:14 +0000
committermarcel <marcel@FreeBSD.org>2007-06-06 05:06:14 +0000
commited1819a480fd38fafd2eae6ea45e8a15981a7147 (patch)
treef219f4b3c8c091afaa88e9084d61b80f66d32e2a /sys/geom/part
parent1094a6916bea7a5dc727f1786045aa2ea706b6e5 (diff)
downloadFreeBSD-src-ed1819a480fd38fafd2eae6ea45e8a15981a7147.zip
FreeBSD-src-ed1819a480fd38fafd2eae6ea45e8a15981a7147.tar.gz
Prefix unknown (i.e. un-aliased) partition types with '!'. This is
how they had to be given with ctlreq.
Diffstat (limited to 'sys/geom/part')
-rw-r--r--sys/geom/part/g_part_apm.c7
-rw-r--r--sys/geom/part/g_part_gpt.c3
2 files changed, 6 insertions, 4 deletions
diff --git a/sys/geom/part/g_part_apm.c b/sys/geom/part/g_part_apm.c
index 50d5c1e..8b2fbc8 100644
--- a/sys/geom/part/g_part_apm.c
+++ b/sys/geom/part/g_part_apm.c
@@ -358,9 +358,10 @@ g_part_apm_type(struct g_part_table *basetable, struct g_part_entry *baseentry,
return (g_part_alias_name(G_PART_ALIAS_FREEBSD_UFS));
if (!strcmp(type, APM_ENT_TYPE_FREEBSD_VINUM))
return (g_part_alias_name(G_PART_ALIAS_FREEBSD_VINUM));
- len = MIN(sizeof(entry->ent.ent_type), bufsz - 1);
- bcopy(type, buf, len);
- buf[len] = '\0';
+ buf[0] = '!';
+ len = MIN(sizeof(entry->ent.ent_type), bufsz - 2);
+ bcopy(type, buf + 1, len);
+ buf[len + 1] = '\0';
return (buf);
}
diff --git a/sys/geom/part/g_part_gpt.c b/sys/geom/part/g_part_gpt.c
index 9f627b7..c3072bc 100644
--- a/sys/geom/part/g_part_gpt.c
+++ b/sys/geom/part/g_part_gpt.c
@@ -602,7 +602,8 @@ g_part_gpt_type(struct g_part_table *basetable, struct g_part_entry *baseentry,
return (g_part_alias_name(G_PART_ALIAS_FREEBSD_VINUM));
if (EQUUID(type, &gpt_uuid_mbr))
return (g_part_alias_name(G_PART_ALIAS_MBR));
- snprintf_uuid(buf, bufsz, type);
+ buf[0] = '!';
+ snprintf_uuid(buf + 1, bufsz - 1, type);
return (buf);
}
OpenPOWER on IntegriCloud