summaryrefslogtreecommitdiff
path: root/external/apache2
diff options
context:
space:
mode:
authortsarna <tsarna@NetBSD.org>2009-10-03 00:03:05 +0000
committertsarna <tsarna@NetBSD.org>2009-10-03 00:03:05 +0000
commit3c8b3fccbd2ddd56da05c66c8b254927d90437eb (patch)
tree9e6b8bacaba1165b947929f5f6736c0a5a429182 /external/apache2
parent1f98cab201e75a1afabf9f6b37f42a7715f93539 (diff)
Make signals match what OS X and the manpage say. Implement toggles for
debug and packet trace logging. Make this conditional on HAVE_SIGINFO. Presumably lack of SIGINFO as a standard posix feature is why they went with different signals here in the first place, but since we have it, let's use it.
Diffstat (limited to 'external/apache2')
-rw-r--r--external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c19
-rw-r--r--external/apache2/mDNSResponder/usr.sbin/mdnsd/Makefile5
2 files changed, 22 insertions, 2 deletions
diff --git a/external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c b/external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c
index dd353514a14..54c87c37109 100644
--- a/external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c
+++ b/external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c
@@ -213,6 +213,10 @@ mDNSlocal mStatus MainLoop(mDNS *m) // Loop until we quit.
mDNSPosixListenForSignalInEventLoop(SIGINT);
mDNSPosixListenForSignalInEventLoop(SIGTERM);
mDNSPosixListenForSignalInEventLoop(SIGUSR1);
+#ifdef HAVE_SIGINFO
+ mDNSPosixListenForSignalInEventLoop(SIGUSR2);
+ mDNSPosixListenForSignalInEventLoop(SIGINFO);
+#endif
mDNSPosixListenForSignalInEventLoop(SIGPIPE);
mDNSPosixListenForSignalInEventLoop(SIGHUP) ;
@@ -239,7 +243,22 @@ mDNSlocal mStatus MainLoop(mDNS *m) // Loop until we quit.
(void) mDNSPosixRunEventLoopOnce(m, &timeout, &signals, &gotData);
if (sigismember(&signals, SIGHUP )) Reconfigure(m);
+#ifdef HAVE_SIGINFO
+ /* use OSX-compatible signals since we can, and gain enhanced debugging */
+ if (sigismember(&signals, SIGINFO)) DumpStateLog(m);
+ if (sigismember(&signals, SIGUSR1))
+ {
+ mDNS_LoggingEnabled = mDNS_LoggingEnabled ? 0 : 1;
+ LogMsg("SIGUSR1: Logging %s", mDNS_LoggingEnabled ? "Enabled" : "Disabled");
+ }
+ if (sigismember(&signals, SIGUSR2))
+ {
+ mDNS_PacketLoggingEnabled = mDNS_PacketLoggingEnabled ? 0 : 1;
+ LogMsg("SIGUSR2: Packet Logging %s", mDNS_PacketLoggingEnabled ? "Enabled" : "Disabled");
+ }
+#else
if (sigismember(&signals, SIGUSR1)) DumpStateLog(m);
+#endif
// SIGPIPE happens when we try to write to a dead client; death should be detected soon in request_callback() and cleaned up.
if (sigismember(&signals, SIGPIPE)) LogMsg("Received SIGPIPE - ignoring");
if (sigismember(&signals, SIGINT) || sigismember(&signals, SIGTERM)) break;
diff --git a/external/apache2/mDNSResponder/usr.sbin/mdnsd/Makefile b/external/apache2/mDNSResponder/usr.sbin/mdnsd/Makefile
index 45a31f5f762..b19ad1f3e26 100644
--- a/external/apache2/mDNSResponder/usr.sbin/mdnsd/Makefile
+++ b/external/apache2/mDNSResponder/usr.sbin/mdnsd/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2009/10/01 10:01:14 tron Exp $
+# $NetBSD: Makefile,v 1.4 2009/10/03 00:03:05 tsarna Exp $
PROG= mdnsd
@@ -6,7 +6,8 @@ PROG= mdnsd
.PATH: ${DIST}/mDNSPosix ${DIST}/mDNSCore ${DIST}/mDNSShared
-CPPFLAGS+=-I${DIST}/mDNSCore -I${DIST}/mDNSShared -DPROGRAM_NAME=\"mdnsd\"
+CPPFLAGS+=-I${DIST}/mDNSCore -I${DIST}/mDNSShared \
+ -DPROGRAM_NAME=\"mdnsd\" -DHAVE_SIGINFO
SRCS= PosixDaemon.c mDNSPosix.c mDNSUNP.c mDNS.c DNSDigest.c uDNS.c \
DNSCommon.c uds_daemon.c mDNSDebug.c dnssd_ipc.c GenLinkedList.c \
PlatformCommon.c