lib/ctf-ir/clock-class.c: only serialize UUID if it is set
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 5 Jul 2017 23:12:57 +0000 (19:12 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 6 Jul 2017 21:24:40 +0000 (17:24 -0400)
Otherwise we get:

    uuid = "00000000-0000-0000-0000-000000000000";

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
lib/ctf-ir/clock-class.c

index 7d02a989ec9ddad8b30d80fcc5166d3ed04544bd..751fe554330d12b3068af94b573b3c0e05f44b84 100644 (file)
@@ -556,12 +556,16 @@ void bt_ctf_clock_class_serialize(struct bt_ctf_clock_class *clock_class,
        g_string_append(context->string, "clock {\n");
        g_string_append_printf(context->string, "\tname = %s;\n",
                clock_class->name->str);
-       g_string_append_printf(context->string,
-               "\tuuid = \"%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x\";\n",
-               uuid[0], uuid[1], uuid[2], uuid[3],
-               uuid[4], uuid[5], uuid[6], uuid[7],
-               uuid[8], uuid[9], uuid[10], uuid[11],
-               uuid[12], uuid[13], uuid[14], uuid[15]);
+
+       if (clock_class->uuid_set) {
+               g_string_append_printf(context->string,
+                       "\tuuid = \"%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x\";\n",
+                       uuid[0], uuid[1], uuid[2], uuid[3],
+                       uuid[4], uuid[5], uuid[6], uuid[7],
+                       uuid[8], uuid[9], uuid[10], uuid[11],
+                       uuid[12], uuid[13], uuid[14], uuid[15]);
+       }
+
        if (clock_class->description) {
                g_string_append_printf(context->string, "\tdescription = \"%s\";\n",
                        clock_class->description->str);
This page took 0.024887 seconds and 4 git commands to generate.