summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ipfwpcap
diff options
context:
space:
mode:
authorcsjp <csjp@FreeBSD.org>2007-10-12 14:57:39 +0000
committercsjp <csjp@FreeBSD.org>2007-10-12 14:57:39 +0000
commitdd1d7df604ec28efea00bc1c45e7d5c5d32cc1d3 (patch)
treee37c6dc43efc681e71b3c602c7c5841b936a0c6f /usr.sbin/ipfwpcap
parent11b9e24e5b368416071de584af40650a0dc74fa6 (diff)
downloadFreeBSD-src-dd1d7df604ec28efea00bc1c45e7d5c5d32cc1d3.zip
FreeBSD-src-dd1d7df604ec28efea00bc1c45e7d5c5d32cc1d3.tar.gz
Add a signal handler for SIGINT to make sure that the PID file
gets cleaned up upon receiving SIGINT. This un-breaks subsequent executions of ipfwpcap and helps when debugging network/divert issues like this: ipfwpcap -r 6000 - | tcpdump -r - MFC after: 1 week
Diffstat (limited to 'usr.sbin/ipfwpcap')
-rw-r--r--usr.sbin/ipfwpcap/ipfwpcap.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/usr.sbin/ipfwpcap/ipfwpcap.c b/usr.sbin/ipfwpcap/ipfwpcap.c
index db0f372..36b764d 100644
--- a/usr.sbin/ipfwpcap/ipfwpcap.c
+++ b/usr.sbin/ipfwpcap/ipfwpcap.c
@@ -106,6 +106,7 @@ int pn;
siginterrupt(SIGHUP, 1);
signal (SIGTERM, quit);
signal (SIGHUP, quit);
+ signal (SIGINT, quit);
n = write(fd, numbuf, numlen);
if (n < 0) { perror(pidfile); quit(23); }
OpenPOWER on IntegriCloud