mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
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: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
committed by
Anthony Liguori
parent
bc7c9eccfe
commit
6514ed528c
+1
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user