]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
test_uuidd: make objdump more robust
authorKarel Zak <kzak@redhat.com>
Fri, 24 Apr 2015 13:01:23 +0000 (15:01 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 24 Apr 2015 13:01:23 +0000 (15:01 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/helpers/test_uuidd.c

index 52b05032488400c8546a85c3fc4a32c001e17e06..7a4f8eb9750377ead76ff5be7e1c0ce7b39433d4 100644 (file)
@@ -228,10 +228,11 @@ static void object_dump(size_t idx, object_t *obj)
        p = uuid_string;
        object_uuid_to_string(obj, &p);
 
-       fprintf(stderr, "object[%zu]: {uuid=<%s>,pid=%d,tid=%d}\n",
-            idx, p,
-            obj->thread->proc->pid,
-            (int) obj->thread->tid);
+       fprintf(stderr, "object[%zu]: {\n", idx);
+       fprintf(stderr, "  uuid:    <%s>\n", p);
+       fprintf(stderr, "  process: %d\n", obj->thread && obj->thread->proc ? (int) obj->thread->proc->pid : 0);
+       fprintf(stderr, "  thread:  %d\n", obj->thread ? (int) obj->thread->tid : 0);
+       fprintf(stderr, "}\n");
 }
 
 int main(int argc, char *argv[])