Fix: reset out_fd_offset when we rotate the trace file
[lttng-tools.git] / src / common / consumer.c
index 221c348df055722918793e32617b6812dcfbc680..59207da2f2f99f03a27b8a014f682025b03e39f7 100644 (file)
@@ -1431,6 +1431,8 @@ ssize_t lttng_consumer_on_read_subbuffer_mmap(
                        outfd = stream->out_fd = ret;
                        /* Reset current size because we just perform a rotation. */
                        stream->tracefile_size_current = 0;
                        outfd = stream->out_fd = ret;
                        /* Reset current size because we just perform a rotation. */
                        stream->tracefile_size_current = 0;
+                       stream->out_fd_offset = 0;
+                       orig_offset = 0;
                }
                stream->tracefile_size_current += len;
        }
                }
                stream->tracefile_size_current += len;
        }
@@ -1614,6 +1616,8 @@ ssize_t lttng_consumer_on_read_subbuffer_splice(
                        outfd = stream->out_fd = ret;
                        /* Reset current size because we just perform a rotation. */
                        stream->tracefile_size_current = 0;
                        outfd = stream->out_fd = ret;
                        /* Reset current size because we just perform a rotation. */
                        stream->tracefile_size_current = 0;
+                       stream->out_fd_offset = 0;
+                       orig_offset = 0;
                }
                stream->tracefile_size_current += len;
        }
                }
                stream->tracefile_size_current += len;
        }
This page took 0.033024 seconds and 4 git commands to generate.