From 1fc4929aa610263a2362afed516d7dc8e689397d Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Mon, 25 Oct 1999 18:59:38 +0000 Subject: [PATCH] syslog support --- bin/named/unix/os.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/bin/named/unix/os.c b/bin/named/unix/os.c index 18c1a69ccc..9f8e27bf37 100644 --- a/bin/named/unix/os.c +++ b/bin/named/unix/os.c @@ -24,6 +24,7 @@ #include #include #include +#include #include @@ -67,10 +68,23 @@ linux_dropprivs() { } #endif +static void +setup_syslog(void) { + int options; + + options = LOG_PID; +#ifdef LOG_NDELAY + options |= LOG_NDELAY; +#endif + + openlog("named", options, LOG_DAEMON); +} isc_result_t ns_os_init(void) { + setup_syslog(); + #ifdef HAVE_LINUX_CAPABILITY_H linux_dropprivs(); #endif @@ -80,7 +94,5 @@ ns_os_init(void) { void ns_os_shutdown(void) { - /* - * Nothing to do. - */ + closelog(); }