diff options
author | marcel <marcel@FreeBSD.org> | 2007-06-06 05:06:14 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2007-06-06 05:06:14 +0000 |
commit | ed1819a480fd38fafd2eae6ea45e8a15981a7147 (patch) | |
tree | f219f4b3c8c091afaa88e9084d61b80f66d32e2a | |
parent | 1094a6916bea7a5dc727f1786045aa2ea706b6e5 (diff) | |
download | FreeBSD-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.
-rw-r--r-- | sys/geom/part/g_part_apm.c | 7 | ||||
-rw-r--r-- | sys/geom/part/g_part_gpt.c | 3 |
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); } |