From: Rob Leslie <rob@mars.org>
Date: Wed, 4 Mar 2009 15:48:04 -0800
Subject: [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.
Forwarded: http://anonsvn.wireshark.org/viewvc?view=rev&revision=29510
Bug-Debian: http://bugs.debian.org/518435

Index: b/dumpcap.c
===================================================================
--- a/dumpcap.c	2010-02-15 17:23:15.000000000 +0100
+++ b/dumpcap.c	2010-02-15 17:24:59.000000000 +0100
@@ -1619,7 +1619,10 @@
         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 {
