ir: stream.c: do not truncate file at each packet flush
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 17 Aug 2017 22:00:27 +0000 (18:00 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 15 Sep 2017 18:23:17 +0000 (14:23 -0400)
The whole stream file is truncated in bt_ctf_stream_destroy() anyway so
truncating at each packet flush is redundant.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
lib/ctf-ir/stream.c

index 4ce2fe3016dce3957c4d078cf7c3e194f268bc87..70f08d189e3d8ce01b98e581ea4b1b4999c24719 100644 (file)
@@ -1715,17 +1715,6 @@ int bt_ctf_stream_flush(struct bt_ctf_stream *stream)
        stream->flushed_packet_count++;
        stream->size += stream->pos.packet_size / CHAR_BIT;
 
-       do {
-               ret = ftruncate(stream->pos.fd, stream->size);
-       } while (ret == -1 && errno == EINTR);
-       if (ret == -1) {
-               BT_LOGE_ERRNO("Cannot truncate stream file to new size",
-                               ": size=%" PRIu64 ", stream-addr=%p, "
-                               "stream-name=\"%s\"",
-                               stream->size, stream,
-                               bt_ctf_stream_get_name(stream));
-       }
-
 end:
        /* Reset automatically-set fields. */
        if (stream->packet_context) {
This page took 0.025632 seconds and 4 git commands to generate.