Add support for setting the syslog facility from the config file
authorSam Leffler <sleffler@google.com>
Sun, 20 Mar 2011 09:48:42 +0000 (11:48 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 20 Mar 2011 09:48:42 +0000 (11:48 +0200)
This enables setting the syslog facility at build time.

src/utils/wpa_debug.c
wpa_supplicant/Makefile

index ba554ef..b8c5e2f 100644 (file)
@@ -78,9 +78,13 @@ void wpa_debug_print_timestamp(void)
 
 
 #ifdef CONFIG_DEBUG_SYSLOG
+#ifndef LOG_HOSTAPD
+#define LOG_HOSTAPD LOG_DAEMON
+#endif /* LOG_HOSTAPD */
+
 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++;
 }
 
index 19cc685..aeb9ab9 100644 (file)
@@ -1225,6 +1225,9 @@ endif
 
 ifdef CONFIG_DEBUG_SYSLOG
 CFLAGS += -DCONFIG_DEBUG_SYSLOG
+ifdef CONFIG_DEBUG_SYSLOG_FACILITY
+CFLAGS += -DLOG_HOSTAPD="$(CONFIG_DEBUG_SYSLOG_FACILITY)"
+endif
 endif
 
 ifdef CONFIG_DEBUG_FILE