Re: [RFAv3 4/6] Implement | (pipe) command.

Pedro Alves
2019-05-27T17:55:14Z

On 5/27/19 6:48 PM, Pedro Alves wrote:
> stdio_file's destructor calls fclose unless you tell it otherwise:
>
> /* Create a ui_file from a previously opened FILE. CLOSE_P
> indicates whether the underlying file should be closed when the
> stdio_file is destroyed. */
> explicit stdio_file (FILE *file, bool close_p = false);
>
>> +
>> + execute_command_to_ui_file (&pipe_file, gdb_cmd.c_str (), from_tty);
> So here this is calling fclose before leaving the scope. But popen
> FILE's should be closed with pclose, only. I don't know why it isn't
> causing problems, may be the glibc's fclose does nothing in this case.
> We shouldn't rely on that.
>

Ahahaha. The argument defaults to false, not true. Silly me.

Thanks,
Pedro Alves