#include <stdarg.h>
#include <stdio.h>
#include <unistd.h>
+#include <string.h>
static int tap_planned = -1;
static int tap_count = 1;
if (strncmp(line, "_TAP", 4)) {
fprintf(normal_stdout, "# %s", line);
} else {
- fprintf(normal_stdout, &line[4]);
+ fprintf(normal_stdout, "# %s", &line[4]);
}
}
pthread_exit(0);
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;