[PATCH 1/8] add support for setting the syslog facility from the config file

Sam Leffler sleffler at google.com
Thu Mar 17 18:39:38 EDT 2011


This enables setting the syslog facility at build time.
---
 src/utils/wpa_debug.c   |    2 +-
 wpa_supplicant/Makefile |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/utils/wpa_debug.c b/src/utils/wpa_debug.c
index ba554ef..4bd9a3d 100644
--- a/src/utils/wpa_debug.c
+++ b/src/utils/wpa_debug.c
@@ -80,7 +80,7 @@ void wpa_debug_print_timestamp(void)
 #ifdef CONFIG_DEBUG_SYSLOG
 void wpa_debug_open_syslog(void)
 {
-	openlog("wpa_supplicant", LOG_PID | LOG_NDELAY, LOG_DAEMON);
+	openlog("wpa_supplicant", LOG_PID | LOG_NDELAY, LOG_HOSTAPD);
 	wpa_debug_syslog++;
 }
 
diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index 19cc685..222c26b 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -1225,6 +1225,12 @@ endif
 
 ifdef CONFIG_DEBUG_SYSLOG
 CFLAGS += -DCONFIG_DEBUG_SYSLOG
+# default syslog facility to LOG_DAEMON
+ifeq ($(CONFIG_DEBUG_SYSLOG_FACILITY),)
+CFLAGS += -DLOG_HOSTAPD="LOG_DAEMON"
+else
+CFLAGS += -DLOG_HOSTAPD="$(CONFIG_DEBUG_SYSLOG_FACILITY)"
+endif
 endif
 
 ifdef CONFIG_DEBUG_FILE
-- 
1.7.3.1



More information about the HostAP mailing list