Skip to content

Commit

Permalink
capture: wait for pcap threads cancellation before exit #253
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaian committed Jul 24, 2018
1 parent 33cf5b7 commit 064ed5a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/capture.c
Expand Up @@ -812,7 +812,9 @@ capture_close()
* you can only break pcap_loop from within the same thread.
* @see: https://www.tcpdump.org/manpages/pcap_breakloop.3pcap.html
*/
pcap_breakloop(capinfo->handle);
pthread_cancel(capinfo->capture_t);
pthread_join(capinfo->capture_t, NULL);
}
}
}
Expand Down

0 comments on commit 064ed5a

Please sign in to comment.