summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHervé Poussineau <hpoussin@reactos.org>2011-11-30 21:35:37 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2011-12-20 15:44:29 -0600
commit6514ed528cd6cf752927b4eb38e64bba84c321ff (patch)
tree83d7c8b90094924b7956323ef9466d7319a6159e
parentbc7c9eccfeb620b0e87b2d0d079d9434c6bef03d (diff)
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>
-rw-r--r--net/dump.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/dump.c b/net/dump.c
index 0d0cbb2591..81324116f3 100644
--- a/net/dump.c
+++ b/net/dump.c
@@ -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;