From: Jens Axboe Date: Mon, 20 Feb 2006 12:41:37 +0000 (+0100) Subject: [PATCH] blktrace: tip_open_output() cleanup X-Git-Tag: blktrace-0.99.1~21 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=0c0b75b4bbb87987242204d71fe1f30e779aa423;p=blktrace.git [PATCH] blktrace: tip_open_output() cleanup --- 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; }