Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
goto end;
}
- /* Check if we need an initial memory map */
- if (!stream->mmap_addr) {
- if (mmap_next(stream)) {
- PERR("Cannot memory-map initial region of file \"%s\" (%p)\n",
- stream->file->path->str, stream->file->fp);
- goto error;
- }
- }
-
/* Check if we have at least one memory-mapped byte left */
if (remaining_mmap_bytes(stream) == 0) {
/* Are we at the end of the file? */
goto error;
}
+ if (file->size == 0) {
+ /* Skip empty stream. */
+ ctf_fs_file_destroy(file);
+ continue;
+ }
+
/* Create a private stream; file ownership is passed to it. */
stream = ctf_fs_stream_create(ctf_fs, file);
if (!stream) {