1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-20 11:11:24 +00:00

Use le_uuid_dec() since GPT UUID's are always in LE format.

Tested by:      Marcel
This commit is contained in:
Poul-Henning Kamp 2003-05-31 16:48:43 +00:00
parent 8313328657
commit 7e28a78f0e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=115460

View File

@ -183,17 +183,19 @@ g_gpt_taste(struct g_class *mp, struct g_provider *pp, int insist)
for (i = 0; i < hdr->hdr_entries; i++) { for (i = 0; i < hdr->hdr_entries; i++) {
struct uuid unused = GPT_ENT_TYPE_UNUSED; struct uuid unused = GPT_ENT_TYPE_UNUSED;
struct uuid freebsd = GPT_ENT_TYPE_FREEBSD; struct uuid freebsd = GPT_ENT_TYPE_FREEBSD;
struct uuid tmp;
if (i >= GPT_MAX_SLICES) if (i >= GPT_MAX_SLICES)
break; break;
ent = (void*)(buf + i * hdr->hdr_entsz); ent = (void*)(buf + i * hdr->hdr_entsz);
if (!memcmp(&ent->ent_type, &unused, sizeof(unused))) le_uuid_dec(&ent->ent_type, &tmp);
if (!memcmp(&tmp, &unused, sizeof(unused)))
continue; continue;
/* XXX: This memory leaks */ /* XXX: This memory leaks */
gs->part[i] = g_malloc(hdr->hdr_entsz, M_WAITOK); gs->part[i] = g_malloc(hdr->hdr_entsz, M_WAITOK);
if (gs->part[i] == NULL) if (gs->part[i] == NULL)
break; break;
bcopy(ent, gs->part[i], hdr->hdr_entsz); bcopy(ent, gs->part[i], hdr->hdr_entsz);
ps = (!memcmp(&ent->ent_type, &freebsd, sizeof(freebsd))) ps = (!memcmp(&tmp, &freebsd, sizeof(freebsd)))
? 's' : 'p'; ? 's' : 'p';
g_topology_lock(); g_topology_lock();
(void)g_slice_config(gp, i, G_SLICE_CONFIG_SET, (void)g_slice_config(gp, i, G_SLICE_CONFIG_SET,