X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=tests%2Ftap.c;h=4bb695ef4ebcccd6a1bd26182b46e28aa394c7a5;hb=8d6300d3b3cb0219e1109e931a2219dbd812b24d;hp=940cc1ae4aefc6c44528ba37bc68b09f6dcd6096;hpb=48beefc91ce09133eac5a09bd856de83b86a54b6;p=ust.git diff --git a/tests/tap.c b/tests/tap.c index 940cc1a..4bb695e 100644 --- a/tests/tap.c +++ b/tests/tap.c @@ -18,6 +18,7 @@ #include #include #include +#include static int tap_planned = -1; static int tap_count = 1; @@ -36,7 +37,7 @@ static void *_tap_comment_stdout(void *_unused) 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); @@ -57,6 +58,9 @@ static void tap_comment_stdout(void) 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!?"); @@ -111,7 +115,7 @@ static void tap_comment_stdout(void) setlinebuf(stdout); setlinebuf(stderr); - setlinebuf(pipe_r_file); + return;