From b657705d8c38b35e2872e4a2c45d0d3858240de4 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Sat, 5 Jun 2010 00:57:07 +0200 Subject: [PATCH] Fix pcap file mode not shutting down on ctrl-c --- src/source-pcap-file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/source-pcap-file.c b/src/source-pcap-file.c index d04220fefa..70f6ca4bda 100644 --- a/src/source-pcap-file.c +++ b/src/source-pcap-file.c @@ -44,6 +44,7 @@ #include "util-error.h" #include "util-privs.h" +extern uint8_t suricata_ctl_flags; extern int max_pending_packets; static int pcap_max_read_packets = 0; @@ -153,7 +154,8 @@ TmEcode ReceivePcapFile(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq, PcapFileThreadVars *ptv = (PcapFileThreadVars *)data; - if (ptv->done == 1) { + if (ptv->done == 1 || suricata_ctl_flags & SURICATA_STOP || + suricata_ctl_flags & SURICATA_KILL) { SCReturnInt(TM_ECODE_FAILED); }