[ Edit: updated patch header ]
The _tap_comment_stdout thread can start using pipe_r_file when it
is still uninitialized. Fix it by moving the initialization before the pthread
creation.
Signed-off-by: Yannick Brosseau <yannick.brosseau@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
goto close_pipe;
}
+ /* Set it before we create the reading thread */
+ setlinebuf(pipe_r_file);
+
stdout_fileno = fileno(stdout);
if (stdout_fileno < 0) {
perror("# Couldn't get fileno for stdout!?");
setlinebuf(stdout);
setlinebuf(stderr);
- setlinebuf(pipe_r_file);
+
return;