提交 6514ed52 编写于 作者: H Hervé Poussineau 提交者: Anthony Liguori

net: truncate output file when using dump backend

This prevents data of a previous run to be seen in the new dump file.
Reviewed-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: NHervé Poussineau <hpoussin@reactos.org>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 bc7c9ecc
......@@ -106,7 +106,7 @@ static int net_dump_init(VLANState *vlan, const char *device,
DumpState *s;
int fd;
fd = open(filename, O_CREAT | O_WRONLY | O_BINARY, 0644);
fd = open(filename, O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0644);
if (fd < 0) {
error_report("-net dump: can't open %s", filename);
return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册