From Rob Leslie <rob@mars.org>:

[PATCH] Fix dumpcap believing error on ^C i.e. pcap_breakloop()
When ^C was pressed during a packet capture, dumpcap believed a pcap
error had occurred.  We check the return value more closely to avoid
this problem.

svn path=/trunk/; revision=29510
This commit is contained in:
Balint Reczey 2009-08-22 22:49:59 +00:00
parent 035231b534
commit 98d79569e0
1 changed files with 4 additions and 1 deletions

View File

@ -1615,7 +1615,10 @@ capture_loop_dispatch(capture_options *capture_opts _U_, loop_data *ld,
inpkts = pcap_dispatch(ld->pcap_h, 1, capture_loop_packet_cb,
(u_char *)ld);
if (inpkts < 0) {
ld->pcap_err = TRUE;
if (inpkts == -1) {
/* Error, rather than pcap_breakloop(). */
ld->pcap_err = TRUE;
}
ld->go = FALSE; /* error or pcap_breakloop() - stop capturing */
}
} else {