[PATCH] blktrace: tip_open_output() cleanup
authorJens Axboe <axboe@suse.de>
Mon, 20 Feb 2006 12:41:37 +0000 (13:41 +0100)
committerJens Axboe <axboe@suse.de>
Mon, 20 Feb 2006 12:41:37 +0000 (13:41 +0100)
blktrace.c

index 94fba1a1eda109ed5e69331c21362cfd01f7131f..c9665a86803d900a87e91b630d6bcc008d1bb542 100644 (file)
@@ -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;
 }