aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlib/main.c')
-rw-r--r--src/vlib/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vlib/main.c b/src/vlib/main.c
index 2df935a5e17..f49790d28b5 100644
--- a/src/vlib/main.c
+++ b/src/vlib/main.c
@@ -2254,7 +2254,7 @@ vlib_pcap_dispatch_trace_configure (vlib_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)