summaryrefslogtreecommitdiffstats
path: root/src/vnet/interface_cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/interface_cli.c')
-rw-r--r--src/vnet/interface_cli.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vnet/interface_cli.c b/src/vnet/interface_cli.c
index 8f1fde7e852..3164f7a31f2 100644
--- a/src/vnet/interface_cli.c
+++ b/src/vnet/interface_cli.c
@@ -1776,7 +1776,7 @@ vnet_pcap_dispatch_trace_configure (vnet_pcap_dispatch_trace_args_t * a)
vlib_cli_output (vm, "Write %d packets to %s, and stop capture...",
pm->n_packets_captured, pm->file_name);
error = pcap_write (pm);
- if (pm->file_descriptor >= 0)
+ if (pm->flags & PCAP_MAIN_INIT_DONE)
pcap_close (pm);
/* Report I/O errors... */
if (error)