From dbf2e104609ba4f4f48766c5f59b87ee67f8ee8c Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Wed, 1 Feb 2006 02:15:44 +0000 Subject: [PATCH] Apply Matt Ghali's --with-syslog-facility patch svn:r5883 --- configure.in | 7 +++++++ src/common/log.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 58eef6c8d9..e85425c060 100644 --- a/configure.in +++ b/configure.in @@ -429,6 +429,13 @@ if [[ $dmalloc -eq 1 ]]; then AC_DEFINE(DMALLOC_FUNC_CHECK, 1, [Enable dmalloc's malloc function check]) fi +# Allow user to specify an alternate syslog facility +AC_ARG_WITH(syslog-facility, +[ --with-syslog-facility=LOG syslog facility to use (default=LOG_DAEMON)], +syslog_facility="$withval", syslog_facility="LOG_DAEMON") +AC_DEFINE_UNQUOTED(LOGFACILITY,$syslog_facility,[name of the syslog facility]) +AC_SUBST(LOGFACILITY) + # Check for gethostbyname_r in all its glorious incompatible versions. # (This logic is based on that in Python's configure.in) AH_TEMPLATE(HAVE_GETHOSTBYNAME_R, diff --git a/src/common/log.c b/src/common/log.c index 760535bb44..2524d5cc21 100644 --- a/src/common/log.c +++ b/src/common/log.c @@ -487,7 +487,7 @@ add_syslog_log(int loglevelMin, int loglevelMax) logfile_t *lf; if (syslog_count++ == 0) /* This is the first syslog. */ - openlog("Tor", LOG_PID | LOG_NDELAY, LOG_DAEMON); + openlog("Tor", LOG_PID | LOG_NDELAY, LOGFACILITY); lf = tor_malloc_zero(sizeof(logfile_t)); lf->min_loglevel = loglevelMin;