}
while ((basename = g_dir_read_name(dir))) {
- struct ctf_fs_file *file;
-
if (strcmp(basename, CTF_FS_METADATA_FILENAME) == 0) {
/* Ignore the metadata stream. */
BT_CPPLOGI_SPEC(ctf_fs_trace->logger,
}
/* Create the file. */
- file = ctf_fs_file_create(ctf_fs_trace->logger).release();
+ const auto file = ctf_fs_file_create(ctf_fs_trace->logger);
if (!file) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(
ctf_fs_trace->logger,
if (!g_file_test(file->path->str, G_FILE_TEST_IS_REGULAR)) {
BT_CPPLOGI_SPEC(ctf_fs_trace->logger, "Ignoring non-regular file `{}`",
file->path->str);
- ctf_fs_file_destroy(file);
- file = NULL;
continue;
}
- ret = ctf_fs_file_open(file, "rb");
+ ret = ctf_fs_file_open(file.get(), "rb");
if (ret) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(ctf_fs_trace->logger, "Cannot open stream file `{}`",
file->path->str);
if (file->size == 0) {
/* Skip empty stream. */
BT_CPPLOGI_SPEC(ctf_fs_trace->logger, "Ignoring empty file `{}`", file->path->str);
- ctf_fs_file_destroy(file);
continue;
}
BT_CPPLOGE_APPEND_CAUSE_SPEC(ctf_fs_trace->logger,
"Cannot add stream file `{}` to stream file group",
file->path->str);
- ctf_fs_file_destroy(file);
goto error;
}
-
- ctf_fs_file_destroy(file);
}
goto end;