diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 8318a96..63ef4af 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -1842,7 +1842,14 @@ int import_stream_packet_index(struct ctf_trace *td, len = fread(&index_hdr, sizeof(index_hdr), 1, pos->index_fp); if (len != 1) { - perror("read index file header"); + char msgbuf[256]; + strerror_r(errno, msgbuf, sizeof(msgbuf) ); + if (len == 0) { + strncpy(msgbuf, "Index file is too short", sizeof(msgbuf) ); + } + fprintf(stderr, "[error] An index file under %s: %s\n", + td->parent.path, msgbuf); + ret = -1; goto error; }