X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Fctf-text%2Fctf-text.c;fp=formats%2Fctf-text%2Fctf-text.c;h=b87718b58ddecabeaa66f7f6de0cfc3bc3701404;hp=e9fd74180dcd9594d7a5a07b35ef6207c67e7ebb;hb=9a3bb76ad636d5b5904e611ee8b4553d900a807c;hpb=33a3f20e5a8a5f6bc36c01a023ba49dd9d256f9a diff --git a/formats/ctf-text/ctf-text.c b/formats/ctf-text/ctf-text.c index e9fd7418..b87718b5 100644 --- a/formats/ctf-text/ctf-text.c +++ b/formats/ctf-text/ctf-text.c @@ -597,10 +597,12 @@ int ctf_text_close_trace(struct bt_trace_descriptor *td) int ret; struct ctf_text_stream_pos *pos = container_of(td, struct ctf_text_stream_pos, trace_descriptor); - ret = fclose(pos->fp); - if (ret) { - perror("Error on fclose"); - return -1; + if (pos->fp != stdout) { + ret = fclose(pos->fp); + if (ret) { + perror("Error on fclose"); + return -1; + } } g_free(pos); return 0;