From brussell at brocade.com Wed Sep 21 10:29:57 2016 From: brussell at brocade.com (Brian Russell) Date: Wed, 21 Sep 2016 10:29:57 +0100 Subject: [Iftop-users] [PATCH] Cleanup pcap Message-ID: <1474450197-10981-1-git-send-email-brussell@brocade.com> Hi, I'm using iftop with my own libpcap extension which has a 0mq socket underneath. To exit gracefully, I need to go through pcap_close to clean up, hence the below patch. Thanks, Brian On exit, call pcap_close() so that any resources used internally by libpcap can be cleaned up. --- iftop.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iftop.c b/iftop.c index a090dcf..f9875c9 100644 --- a/iftop.c +++ b/iftop.c @@ -839,6 +839,8 @@ int main(int argc, char **argv) { } pthread_cancel(thread); + pthread_join(thread, NULL); + pcap_close(pd); ui_finish(); -- 2.1.4