Test fix: handle debug info disabled in test_convert_args
[babeltrace.git] / plugins / ctf / fs-src / data-stream-file.c
index 76b58da90d5aa527827b90b366d47cc4f3934bcd..76ea9ad502939758176908b41e15c09a54650901 100644 (file)
@@ -63,10 +63,11 @@ int ds_file_munmap(struct ctf_fs_ds_file *ds_file)
        }
 
        if (bt_munmap(ds_file->mmap_addr, ds_file->mmap_len)) {
-               BT_LOGE("Cannot memory-unmap address %p (size %zu) of file \"%s\" (%p): %s",
+               BT_LOGE_ERRNO("Cannot memory-unmap file",
+                       ": address=%p, size=%zu, file_path=\"%s\", file=%p",
                        ds_file->mmap_addr, ds_file->mmap_len,
-                       ds_file->file->path->str, ds_file->file->fp,
-                       strerror(errno));
+                       ds_file->file->path->str,
+                       ds_file->file ? ds_file->file->fp : NULL);
                ret = -1;
                goto end;
        }
@@ -110,9 +111,9 @@ enum bt_ctf_notif_iter_medium_status ds_file_mmap_next(
                        PROT_READ, MAP_PRIVATE, fileno(ds_file->file->fp),
                        ds_file->mmap_offset);
        if (ds_file->mmap_addr == MAP_FAILED) {
-               BT_LOGE("Cannot memory-map address (size %zu) of file \"%s\" (%p) at offset %zu: %s",
+               BT_LOGE("Cannot memory-map address (size %zu) of file \"%s\" (%p) at offset %jd: %s",
                                ds_file->mmap_len, ds_file->file->path->str,
-                               ds_file->file->fp, ds_file->mmap_offset,
+                               ds_file->file->fp, (intmax_t) ds_file->mmap_offset,
                                strerror(errno));
                goto error;
        }
This page took 0.028335 seconds and 4 git commands to generate.