diff --git a/src/utils/wpa_debug.c b/src/utils/wpa_debug.c index fa453eb61..27a61c0f2 100644 --- a/src/utils/wpa_debug.c +++ b/src/utils/wpa_debug.c @@ -23,9 +23,6 @@ static int wpa_debug_syslog = 0; #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_show_keys = 0; int wpa_debug_timestamp = 0; @@ -33,6 +30,11 @@ int wpa_debug_timestamp = 0; #ifndef CONFIG_NO_STDOUT_DEBUG +#ifdef CONFIG_DEBUG_FILE +static FILE *out_file = NULL; +#endif /* CONFIG_DEBUG_FILE */ + + void wpa_debug_print_timestamp(void) { struct os_time tv; diff --git a/src/utils/wpa_debug.h b/src/utils/wpa_debug.h index 018d63423..0c8cdf2bc 100644 --- a/src/utils/wpa_debug.h +++ b/src/utils/wpa_debug.h @@ -38,6 +38,11 @@ enum { #define wpa_debug_close_file() 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 */ 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_ctrl(args...) 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 */ /** * wpa_msg - Conditional printf for default target and ctrl_iface monitors diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index c32f01c1e..7b0bbd166 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -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) { struct wpa_supplicant *wpa_s = ctx; @@ -2345,6 +2346,7 @@ static const char * wpa_supplicant_msg_ifname_cb(void *ctx) return NULL; 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) return NULL; +#ifndef CONFIG_NO_WPA_MSG wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb); +#endif /* CONFIG_NO_WPA_MSG */ wpa_debug_open_file(params->wpa_debug_file_path); if (params->wpa_debug_syslog)