X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fctfser%2Fctfser.c;h=0806c8bab73899da5e4e40939d52623b107bc92e;hb=c4f23e30bf67d2523163614bc9461d84cbe1ae80;hp=b28845cf8f5649bad43d69f7a4d87ea98e9faf0a;hpb=86d8b7b82095055ced36135ecf4336753360cea4;p=babeltrace.git diff --git a/src/ctfser/ctfser.c b/src/ctfser/ctfser.c index b28845cf..0806c8ba 100644 --- a/src/ctfser/ctfser.c +++ b/src/ctfser/ctfser.c @@ -37,7 +37,6 @@ #include #include #include -#include #include "common/macros.h" #include "common/common.h" #include "ctfser/ctfser.h" @@ -144,6 +143,19 @@ int bt_ctfser_fini(struct bt_ctfser *ctfser) goto free_path; } + if (ctfser->base_mma) { + /* Unmap old base */ + ret = munmap_align(ctfser->base_mma); + if (ret) { + BT_LOGE_ERRNO("Failed to unmap stream file", + ": ret=%d, size-bytes=%" PRIu64, + ret, ctfser->stream_size_bytes); + goto end; + } + + ctfser->base_mma = NULL; + } + /* * Truncate the stream file's size to the minimum required to * fit the last packet as we might have grown it too much during @@ -160,18 +172,6 @@ int bt_ctfser_fini(struct bt_ctfser *ctfser) goto end; } - if (ctfser->base_mma) { - /* Unmap old base */ - ret = munmap_align(ctfser->base_mma); - if (ret) { - BT_LOGE_ERRNO("Failed to unmap stream file", - ": ret=%d, size-bytes=%" PRIu64, - ret, ctfser->stream_size_bytes); - goto end; - } - - ctfser->base_mma = NULL; - } ret = close(ctfser->fd); if (ret) {