From 35a14714c0fa761928e3da32584b29a66ba9490a Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 11 Feb 2001 21:29:03 +0000 Subject: Report failures of "pcap_stats()", as tcpdump does. Print the "Capturing on " message, the running count of packets captured, and error messages to the standard error in Tethereal, so that you can pipe the output of a live capture that's printing packets to a program or script without that script having to worry about parsing stuff other than dissected packet summaries or details (tcpdump does the same). svn path=/trunk/; revision=3017 --- capture.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'capture.c') diff --git a/capture.c b/capture.c index b8a0fa2faf..ff4d35ac56 100644 --- a/capture.c +++ b/capture.c @@ -1,7 +1,7 @@ /* capture.c * Routines for packet capture windows * - * $Id: capture.c,v 1.139 2001/02/11 09:28:15 guy Exp $ + * $Id: capture.c,v 1.140 2001/02/11 21:29:03 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -1604,6 +1604,11 @@ capture(gboolean *stats_known, struct pcap_stat *stats) dropped. */ if (pcap_stats(pch, stats) >= 0) *stats_known = TRUE; + else { + simple_dialog(ESD_TYPE_WARN, NULL, + "Can't get packet-drop statistics: %s", + pcap_geterr(pch)); + } pcap_close(pch); } -- cgit v1.2.3