]> The Tcpdump Group git mirrors - tcpdump/commitdiff
From Jesper Peterson <[email protected]>: catch SIGPIPE and clean up, so
authorguy <guy>
Wed, 30 Jul 2003 05:51:40 +0000 (05:51 +0000)
committerguy <guy>
Wed, 30 Jul 2003 05:51:40 +0000 (05:51 +0000)
that if tcpdump is being piped to some other program, and that program
exits before tcpdump does, tcpdump will cleanly exit, so that libpcap
can cleanly close devices (such as Endace's DAG cards).

CREDITS
tcpdump.c

diff --git a/CREDITS b/CREDITS
index ff399908f572b4c40584d7711feb9790d7f9dae6..8a1f51be43f71e9bdcd7df2f1918e7db82760bc4 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -51,6 +51,7 @@ Additional people who have contributed patches:
        Jason R. Thorpe                 <[email protected]>
        Jefferson Ogata                 <[email protected]>
        Jeffrey Hutzelman               <[email protected]>
+       Jesper Peterson                 <[email protected]>
        Jim Hutchins                    <[email protected]>
        Tatuya Jinmei                   <[email protected]>
        Jørgen Thomsen                  <[email protected]
index 059d254671f9e253e35613b3de93d81a76f47b5c..d340c43c886d6dd8f267d43aab6ffd0ed3cd7be7 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -30,7 +30,7 @@ static const char copyright[] =
     "@(#) 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[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.209 2003-06-03 23:32:42 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.210 2003-07-30 05:51:40 guy Exp $ (LBL)";
 #endif
 
 /*
@@ -703,6 +703,9 @@ main(int argc, char **argv)
        }
        init_addrtoname(localnet, netmask);
 
+#ifndef WIN32  
+       (void)setsignal(SIGPIPE, cleanup);
+#endif /* WIN32 */
        (void)setsignal(SIGTERM, cleanup);
        (void)setsignal(SIGINT, cleanup);
        /* Cooperate with nohup(1) */