From 16cd0c80e478d99e6645868e04ff2422d3320e47 Mon Sep 17 00:00:00 2001 From: Julien Desfossez Date: Fri, 2 Jun 2017 09:18:31 -0400 Subject: [PATCH] clock description is optional MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Julien Desfossez Signed-off-by: Jérémie Galarneau --- plugins/libctfcopytrace/ctfcopytrace.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/plugins/libctfcopytrace/ctfcopytrace.c b/plugins/libctfcopytrace/ctfcopytrace.c index bfd51129..8c54d43c 100644 --- a/plugins/libctfcopytrace/ctfcopytrace.c +++ b/plugins/libctfcopytrace/ctfcopytrace.c @@ -66,18 +66,14 @@ struct bt_ctf_clock_class *ctf_copy_clock_class(FILE *err, } description = bt_ctf_clock_class_get_description(clock_class); - if (!description) { - fprintf(err, "[error] %s in %s:%d\n", __func__, __FILE__, - __LINE__); - goto end_destroy; - } - - int_ret = bt_ctf_clock_class_set_description(writer_clock_class, - description); - if (int_ret != 0) { - fprintf(err, "[error] %s in %s:%d\n", __func__, __FILE__, - __LINE__); - goto end_destroy; + if (description) { + int_ret = bt_ctf_clock_class_set_description(writer_clock_class, + description); + if (int_ret != 0) { + fprintf(err, "[error] %s in %s:%d\n", __func__, __FILE__, + __LINE__); + goto end_destroy; + } } u64_ret = bt_ctf_clock_class_get_frequency(clock_class); -- 2.34.1