X-Git-Url: https://git.efficios.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Fplugins%2Fctf%2Ffs-src%2Ffs.c;h=0f28a09a8e6376f1792285f5822e56bd7537e382;hb=2d06585f25d1bc213c9755665ade492b4f4cf023;hp=eb8dbe53e7f803c114b5fbeeda44688e066ab958;hpb=55e57fc952297e772d08a4b71d2447341f54c82b;p=babeltrace.git diff --git a/src/plugins/ctf/fs-src/fs.c b/src/plugins/ctf/fs-src/fs.c index eb8dbe53..0f28a09a 100644 --- a/src/plugins/ctf/fs-src/fs.c +++ b/src/plugins/ctf/fs-src/fs.c @@ -127,17 +127,23 @@ bt_component_class_message_iterator_next_method_status ctf_fs_iterator_next_one( BT_ASSERT_DBG(msg_iter_data->ds_file); while (true) { - status = ctf_fs_ds_file_next(msg_iter_data->msg_iter, out_msg); - switch (status) { - case BT_COMPONENT_CLASS_MESSAGE_ITERATOR_NEXT_METHOD_STATUS_OK: + enum ctf_msg_iter_status msg_iter_status; + int ret; + + msg_iter_status = ctf_msg_iter_get_next_message( + msg_iter_data->msg_iter, out_msg); + + switch (msg_iter_status) { + case CTF_MSG_ITER_STATUS_OK: + /* Cool, message has been written to *out_msg. */ + status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_NEXT_METHOD_STATUS_OK; goto end; - case BT_COMPONENT_CLASS_MESSAGE_ITERATOR_NEXT_METHOD_STATUS_END: - { - int ret; + case CTF_MSG_ITER_STATUS_EOF: if (msg_iter_data->ds_file_info_index == msg_iter_data->ds_file_group->ds_file_infos->len - 1) { /* End of all group's stream files */ + status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_NEXT_METHOD_STATUS_END; goto end; } @@ -157,10 +163,19 @@ bt_component_class_message_iterator_next_method_status ctf_fs_iterator_next_one( goto end; } - /* Continue the loop to get the next message */ + /* Continue the loop to get the next message. */ break; - } + + case CTF_MSG_ITER_STATUS_AGAIN: + /* + * Should not make it this far as this is + * medium-specific; there is nothing for the user to do + * and it should have been handled upstream. + */ + bt_common_abort(); + default: + status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_NEXT_METHOD_STATUS_ERROR; goto end; } }