summaryrefslogtreecommitdiffstats
path: root/tests/helpers
diff options
context:
space:
mode:
authorKarel Zak2015-04-24 15:01:23 +0200
committerKarel Zak2015-04-24 15:01:23 +0200
commit032776e8b068b7a02b22736f900eb5962b7f8770 (patch)
treeed9309f8e9e3dab264869e2603e6ef95966d69ca /tests/helpers
parenttest_uuidd: fix include (diff)
downloadkernel-qcow2-util-linux-032776e8b068b7a02b22736f900eb5962b7f8770.tar.gz
kernel-qcow2-util-linux-032776e8b068b7a02b22736f900eb5962b7f8770.tar.xz
kernel-qcow2-util-linux-032776e8b068b7a02b22736f900eb5962b7f8770.zip
test_uuidd: make objdump more robust
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tests/helpers')
-rw-r--r--tests/helpers/test_uuidd.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/helpers/test_uuidd.c b/tests/helpers/test_uuidd.c
index 52b050324..7a4f8eb97 100644
--- a/tests/helpers/test_uuidd.c
+++ b/tests/helpers/test_uuidd.c
@@ -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[])