From 0c0b75b4bbb87987242204d71fe1f30e779aa423 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 20 Feb 2006 13:41:37 +0100 Subject: [PATCH] [PATCH] blktrace: tip_open_output() cleanup --- blktrace.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/blktrace.c b/blktrace.c index 94fba1a..c9665a8 100644 --- a/blktrace.c +++ b/blktrace.c @@ -1069,8 +1069,7 @@ static int tip_open_output(struct device_information *dip, tip->ofile = NULL; tip->ofile_stdout = 0; tip->ofile_mmap = 0; - vbuf_size = 0; - mode = 0; /* gcc 4.x issues a bogus warning */ + goto done; } else if (pipeline) { tip->ofile = fdopen(STDOUT_FILENO, "w"); tip->ofile_stdout = 1; @@ -1087,20 +1086,19 @@ static int tip_open_output(struct device_information *dip, vbuf_size = OFILE_BUF; } - if (net_mode != Net_client && tip->ofile == NULL) { + if (tip->ofile == NULL) { perror(op); return 1; } - if (vbuf_size) { - tip->ofile_buffer = malloc(vbuf_size); - if (setvbuf(tip->ofile, tip->ofile_buffer, mode, vbuf_size)) { - perror("setvbuf"); - close_thread(tip); - return 1; - } + tip->ofile_buffer = malloc(vbuf_size); + if (setvbuf(tip->ofile, tip->ofile_buffer, mode, vbuf_size)) { + perror("setvbuf"); + close_thread(tip); + return 1; } +done: fill_ops(tip); return 0; } -- 2.25.1