Fix CONFIG_NO_STDOUT_DEBUG=y build

This commit is contained in:
Jouni Malinen 2011-02-10 20:24:06 +02:00 committed by Jouni Malinen
parent f049052b9e
commit 50b16da13f
3 changed files with 15 additions and 3 deletions

View file

@ -23,9 +23,6 @@ static int wpa_debug_syslog = 0;
#endif /* CONFIG_DEBUG_SYSLOG */ #endif /* CONFIG_DEBUG_SYSLOG */
#ifdef CONFIG_DEBUG_FILE
static FILE *out_file = NULL;
#endif /* CONFIG_DEBUG_FILE */
int wpa_debug_level = MSG_INFO; int wpa_debug_level = MSG_INFO;
int wpa_debug_show_keys = 0; int wpa_debug_show_keys = 0;
int wpa_debug_timestamp = 0; int wpa_debug_timestamp = 0;
@ -33,6 +30,11 @@ int wpa_debug_timestamp = 0;
#ifndef CONFIG_NO_STDOUT_DEBUG #ifndef CONFIG_NO_STDOUT_DEBUG
#ifdef CONFIG_DEBUG_FILE
static FILE *out_file = NULL;
#endif /* CONFIG_DEBUG_FILE */
void wpa_debug_print_timestamp(void) void wpa_debug_print_timestamp(void)
{ {
struct os_time tv; struct os_time tv;

View file

@ -38,6 +38,11 @@ enum {
#define wpa_debug_close_file() do { } while (0) #define wpa_debug_close_file() do { } while (0)
#define wpa_dbg(args...) do { } while (0) #define wpa_dbg(args...) do { } while (0)
static inline int wpa_debug_reopen_file(void)
{
return 0;
}
#else /* CONFIG_NO_STDOUT_DEBUG */ #else /* CONFIG_NO_STDOUT_DEBUG */
int wpa_debug_open_file(const char *path); int wpa_debug_open_file(const char *path);
@ -157,6 +162,7 @@ void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf,
#define wpa_msg(args...) do { } while (0) #define wpa_msg(args...) do { } while (0)
#define wpa_msg_ctrl(args...) do { } while (0) #define wpa_msg_ctrl(args...) do { } while (0)
#define wpa_msg_register_cb(f) do { } while (0) #define wpa_msg_register_cb(f) do { } while (0)
#define wpa_msg_register_ifname_cb(f) do { } while (0)
#else /* CONFIG_NO_WPA_MSG */ #else /* CONFIG_NO_WPA_MSG */
/** /**
* wpa_msg - Conditional printf for default target and ctrl_iface monitors * wpa_msg - Conditional printf for default target and ctrl_iface monitors

View file

@ -2338,6 +2338,7 @@ struct wpa_supplicant * wpa_supplicant_get_iface(struct wpa_global *global,
} }
#ifndef CONFIG_NO_WPA_MSG
static const char * wpa_supplicant_msg_ifname_cb(void *ctx) static const char * wpa_supplicant_msg_ifname_cb(void *ctx)
{ {
struct wpa_supplicant *wpa_s = ctx; struct wpa_supplicant *wpa_s = ctx;
@ -2345,6 +2346,7 @@ static const char * wpa_supplicant_msg_ifname_cb(void *ctx)
return NULL; return NULL;
return wpa_s->ifname; return wpa_s->ifname;
} }
#endif /* CONFIG_NO_WPA_MSG */
/** /**
@ -2364,7 +2366,9 @@ struct wpa_global * wpa_supplicant_init(struct wpa_params *params)
if (params == NULL) if (params == NULL)
return NULL; return NULL;
#ifndef CONFIG_NO_WPA_MSG
wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb); wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb);
#endif /* CONFIG_NO_WPA_MSG */
wpa_debug_open_file(params->wpa_debug_file_path); wpa_debug_open_file(params->wpa_debug_file_path);
if (params->wpa_debug_syslog) if (params->wpa_debug_syslog)