]> The Tcpdump Group git mirrors - tcpdump/commitdiff
..and don't bother trying to get statistics if we're reading from a
authorguy <guy>
Wed, 21 Nov 2007 20:39:24 +0000 (20:39 +0000)
committerguy <guy>
Wed, 21 Nov 2007 20:39:24 +0000 (20:39 +0000)
capture file rather than capturing (statistics aren't supported by
libpcap when reading from a capture file).

tcpdump.c

index 7fb72bd91d1dfecb2588236c0bd98c87b597ce41..e004378708f0e56970c1a3f5313d4f90d8c076f1 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -30,7 +30,7 @@ static const char copyright[] _U_ =
     "@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000\n\
 The Regents of the University of California.  All rights reserved.\n";
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.273 2007-11-21 20:31:31 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.274 2007-11-21 20:39:24 guy Exp $ (LBL)";
 #endif
 
 /*
@@ -1071,7 +1071,12 @@ main(int argc, char **argv)
        }
 #endif /* WIN32 */
 #ifdef SIGINFO
-       (void)setsignal(SIGINFO, requestinfo);
+       /*
+        * We can't get statistics when reading from a file rather
+        * than capturing from a device.
+        */
+       if (RFileName == NULL)
+               (void)setsignal(SIGINFO, requestinfo);
 #endif
 
        if (vflag > 0 && WFileName) {