- vstream = viewer_stream_find_by_id(stream->stream_handle);
- if (vstream) {
- /*
- * The viewer is reading a file about to be
- * overwritten. Close the FDs it is
- * currently using and let it handle the fault.
- */
- if (vstream->tracefile_count_current == new_id) {
- pthread_mutex_lock(&vstream->overwrite_lock);
- vstream->abort_flag = 1;
- pthread_mutex_unlock(&vstream->overwrite_lock);
- DBG("Streaming side setting abort_flag on stream %s_%lu\n",
- stream->channel_name, new_id);
- } else if (vstream->tracefile_count_current ==
- stream->tracefile_count_current) {
- /*
- * The reader and writer were in the
- * same trace file, inform the viewer
- * that no new index will ever be added
- * to this file.
- */
- vstream->close_write_flag = 1;
- }
- }
- ret = utils_rotate_stream_file(stream->path_name, stream->channel_name,
- stream->tracefile_size, stream->tracefile_count,
- relayd_uid, relayd_gid, stream->fd,
- &(stream->tracefile_count_current), &stream->fd);
- pthread_mutex_unlock(&stream->viewer_stream_rotation_lock);
+ ret = utils_rotate_stream_file(stream->path_name,
+ stream->channel_name, stream->tracefile_size,
+ stream->tracefile_count, -1,
+ -1, stream->stream_fd->fd,
+ &stream->current_tracefile_id,
+ &stream->stream_fd->fd);