X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=converter%2Fbabeltrace-log.c;h=9d87776a8f361ade58a7557215d99fe8a56916fd;hp=d24f011e5ed214785840da4435fe447b4a491c1f;hb=a7af71619e2ca1e763d90a8156fe4206c012d8cc;hpb=fef3bf22431390dae389d378b7709366b158b83d diff --git a/converter/babeltrace-log.c b/converter/babeltrace-log.c index d24f011e..9d87776a 100644 --- a/converter/babeltrace-log.c +++ b/converter/babeltrace-log.c @@ -231,10 +231,14 @@ void trace_text(FILE *input, int output) ssize_t len; char *line = NULL, *nl; size_t linesize; + int ret; memset(&pos, 0, sizeof(pos)); - ctf_init_pos(&pos, output, O_RDWR); - + ret = ctf_init_pos(&pos, output, O_RDWR); + if (ret) { + fprintf(stderr, "Error in ctf_init_pos\n"); + return; + } write_packet_header(&pos, s_uuid); write_packet_context(&pos); for (;;) { @@ -249,7 +253,10 @@ void trace_text(FILE *input, int output) trace_string(line, &pos, strlen(line) + 1); } } - ctf_fini_pos(&pos); + ret = ctf_fini_pos(&pos); + if (ret) { + fprintf(stderr, "Error in ctf_fini_pos\n"); + } } static @@ -347,7 +354,9 @@ int main(int argc, char **argv) print_metadata(metadata_fp); trace_text(stdin, fd); - close(fd); + ret = close(fd); + if (ret) + perror("close"); exit(EXIT_SUCCESS); /* error handling */