diff options
author | Hervé Poussineau <hpoussin@reactos.org> | 2011-11-30 21:35:37 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-20 15:44:29 -0600 |
commit | 6514ed528cd6cf752927b4eb38e64bba84c321ff (patch) | |
tree | 83d7c8b90094924b7956323ef9466d7319a6159e /net | |
parent | bc7c9eccfeb620b0e87b2d0d079d9434c6bef03d (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>
Diffstat (limited to 'net')
-rw-r--r-- | net/dump.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/dump.c b/net/dump.c index 0d0cbb259..81324116f 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; |