From: Rik Faith Date: Thu, 29 May 2014 20:13:39 +0000 (-0600) Subject: ETA no longer works when -o specified X-Git-Tag: fio-2.1.10~8 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=988da1208e6dac18a0144888ad19dcc44e4c2ae3;p=fio.git ETA no longer works when -o specified Regarding fio version fio-2.1.9-17-gd9b1 (after April 11, 2014): A recent change (5e1d8745471d1f315113c5c3fd8b93809d9ddff9) caused stdout to be closed when -o was specified, which prevents ETA output from showing up on stdout even when, e.g., json is being saved in the file. This patch continues to close f_out so that there is no leak if multiple -o options are specified, but doesn't close stdout. Hence, ETA works again when it should. Signed-off-by: Jens Axboe --- diff --git a/init.c b/init.c index 4c5a8dd8..a5468615 100644 --- a/init.c +++ b/init.c @@ -1739,7 +1739,7 @@ int parse_cmd_line(int argc, char *argv[], int client_type) write_bw_log = 1; break; case 'o': - if (f_out) + if (f_out && f_out != stdout) fclose(f_out); f_out = fopen(optarg, "w+");