提交 7fb8b5d9 编写于 作者: C Chen Gang 提交者: Michael Tokarev

vl: avoid closing stdout with 'writeconfig'

'writeconfig' supports output to stdout (with '-'); when that happens,
we must not close stdout, or further command line options that also use
stdout will be impacted. (Although 'writeconfig' was copied from
'readconfig', the latter does not have the problem because it does not
support reading from '-')
Signed-off-by: NChen Gang <gang.chen.5i5j@gmail.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
上级 24c12b79
......@@ -3890,7 +3890,9 @@ int main(int argc, char **argv, char **envp)
}
}
qemu_config_write(fp);
fclose(fp);
if (fp != stdout) {
fclose(fp);
}
break;
}
case QEMU_OPTION_qtest:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册