Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/gpt If we want to GUIDs to display with correct endian, ...



details:   https://anonhg.NetBSD.org/src/rev/ad497410f1e9
branches:  trunk
changeset: 325316:ad497410f1e9
user:      jnemeth <jnemeth%NetBSD.org@localhost>
date:      Wed Dec 18 03:20:09 2013 +0000

description:
If we want to GUIDs to display with correct endian, it helps to decode it first.

diffstat:

 sbin/gpt/show.c |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (51 lines):

diff -r 7763e5dc4791 -r ad497410f1e9 sbin/gpt/show.c
--- a/sbin/gpt/show.c   Tue Dec 17 22:39:23 2013 +0000
+++ b/sbin/gpt/show.c   Wed Dec 18 03:20:09 2013 +0000
@@ -29,7 +29,7 @@
 __FBSDID("$FreeBSD: src/sbin/gpt/show.c,v 1.14 2006/06/22 22:22:32 marcel Exp $");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: show.c,v 1.14 2013/12/09 01:35:02 jnemeth Exp $");
+__RCSID("$NetBSD: show.c,v 1.15 2013/12/18 03:20:09 jnemeth Exp $");
 #endif
 
 #include <sys/types.h>
@@ -134,7 +134,7 @@
 static void
 show(void)
 {
-       uuid_t type;
+       uuid_t guid, type;
        off_t start;
        map_t *m, *p;
        struct mbr *mbr;
@@ -198,8 +198,8 @@
                                printf("- \"%s\"",
                                    utf16_to_utf8(ent->ent_name));
                        } else if (show_guid) {
-                               uuid_to_string((uuid_t *)ent->ent_guid,
-                                   &s, NULL);
+                               le_uuid_dec(ent->ent_guid, &guid);
+                               uuid_to_string(&guid, &s, NULL);
                                printf("- %s", s);
                                free(s);
                        } else {
@@ -219,7 +219,7 @@
 static void
 show_one(void)
 {
-       uuid_t type;
+       uuid_t guid, type;
        map_t *m;
        struct gpt_ent *ent;
        const char *s1;
@@ -260,7 +260,8 @@
        printf("Type: %s (%s)\n", s1, s2);
        free(s2);
 
-       uuid_to_string((uuid_t *)ent->ent_guid, &s2, NULL);
+       le_uuid_dec(ent->ent_guid, &guid);
+       uuid_to_string(&guid, &s2, NULL);
        printf("GUID: %s\n", s2);
        free(s2);
 



Home | Main Index | Thread Index | Old Index