From 2e76e92b45e1ac029309bd9f28d1bfeab9d1c953 Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Tue, 25 Mar 2008 21:47:03 +0000 Subject: [PATCH] fix botched merge of syslog support to the vendor branch; these files were off the branch so we need to pull the changes back up --- contrib/wpa_supplicant/main.c | 12 ++++++++++-- contrib/wpa_supplicant/wpa_supplicant.c | 3 +++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/contrib/wpa_supplicant/main.c b/contrib/wpa_supplicant/main.c index 8ce4ef2484cb..aaef8220d1f6 100644 --- a/contrib/wpa_supplicant/main.c +++ b/contrib/wpa_supplicant/main.c @@ -41,7 +41,7 @@ static void usage(void) int i; printf("%s\n\n%s\n" "usage:\n" - " wpa_supplicant [-BddhKLqqtuvwW] [-P] " + " wpa_supplicant [-BddhKLqqstuvwW] [-P] " "[-g] \\\n" " -i -c [-C] [-D] " "[-p] \\\n" @@ -79,6 +79,9 @@ static void usage(void) printf(" -p = driver parameters\n" " -P = PID file\n" " -q = decrease debugging verbosity (-qq even less)\n" +#ifdef CONFIG_DEBUG_SYSLOG + " -s = log output to syslog instead of stdout\n" +#endif /* CONFIG_DEBUG_SYSLOG */ #ifdef CONFIG_CTRL_IFACE_DBUS " -u = enable DBus control interface\n" #endif /* CONFIG_CTRL_IFACE_DBUS */ @@ -149,7 +152,7 @@ int main(int argc, char *argv[]) wpa_supplicant_fd_workaround(); for (;;) { - c = getopt(argc, argv, "b:Bc:C:D:df:g:hi:KLNp:P:qtuvwW"); + c = getopt(argc, argv, "b:Bc:C:D:df:g:hi:KLNp:P:qstuvwW"); if (c < 0) break; switch (c) { @@ -210,6 +213,11 @@ int main(int argc, char *argv[]) case 'q': params.wpa_debug_level++; break; +#ifdef CONFIG_DEBUG_SYSLOG + case 's': + params.wpa_debug_syslog++; + break; +#endif /* CONFIG_DEBUG_SYSLOG */ case 't': params.wpa_debug_timestamp++; break; diff --git a/contrib/wpa_supplicant/wpa_supplicant.c b/contrib/wpa_supplicant/wpa_supplicant.c index 761445c290d1..95c8b1bbff9e 100644 --- a/contrib/wpa_supplicant/wpa_supplicant.c +++ b/contrib/wpa_supplicant/wpa_supplicant.c @@ -2490,6 +2490,8 @@ struct wpa_global * wpa_supplicant_init(struct wpa_params *params) return NULL; wpa_debug_open_file(params->wpa_debug_file_path); + if (params->wpa_debug_syslog) + wpa_debug_open_syslog(); ret = eap_peer_register_methods(); if (ret) { @@ -2614,5 +2616,6 @@ void wpa_supplicant_deinit(struct wpa_global *global) os_free(global->params.ctrl_interface); os_free(global); + wpa_debug_close_syslog(); wpa_debug_close_file(); }