On Tue, 2 Mar 2021 16:51:56 +0200 Tzvetomir Stoyanov <tz.stoyanov@xxxxxxxxx> wrote: > > handle->file_state = state; > > The output handle should have the same state as the input handle, > so we can just have: > > handle->file_state = tracecmd_get_file_state(ihandle); > > There is exactly the same use case in tracecmd_get_output_handle_fd(), > where the out handle is built on a partially written file. The above is pretty much exactly what I did, but it eliminates error checking. Should there be a file_state = TRACECMD_FILE_ERROR ? -- Steve