aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-10-25 18:43:15 (GMT)
committerJouni Malinen <j@w1.fi>2015-10-25 18:45:02 (GMT)
commitd8fd633ebb5c0ef288ab184fe55e534b36600745 (patch)
treecfa4df5316c121ed2f76f1313e8090a885cf58dc /src/utils
parent67deaa582d0e1e3cc264dd7b2133f839c430e864 (diff)
downloadhostap-d8fd633ebb5c0ef288ab184fe55e534b36600745.zip
hostap-d8fd633ebb5c0ef288ab184fe55e534b36600745.tar.gz
hostap-d8fd633ebb5c0ef288ab184fe55e534b36600745.tar.bz2
Do not write ERROR level log entries if debug file is not used
wpa_debug_reopen_file() used to write an error message at MSG_ERROR level if it was called with last_path == NULL (the last debug log file path not known). This is not a fatal error, but a normal case if wpa_debug_open_file() has not been used. Remove the error message and return success in such case. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/wpa_debug.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/utils/wpa_debug.c b/src/utils/wpa_debug.c
index 61c0d5c..3275524 100644
--- a/src/utils/wpa_debug.c
+++ b/src/utils/wpa_debug.c
@@ -517,16 +517,18 @@ int wpa_debug_reopen_file(void)
{
#ifdef CONFIG_DEBUG_FILE
int rv;
- if (last_path) {
- char *tmp = os_strdup(last_path);
- wpa_debug_close_file();
- rv = wpa_debug_open_file(tmp);
- os_free(tmp);
- } else {
- wpa_printf(MSG_ERROR, "Last-path was not set, cannot "
- "re-open log file.");
- rv = -1;
- }
+ char *tmp;
+
+ if (!last_path)
+ return 0; /* logfile not used */
+
+ tmp = os_strdup(last_path);
+ if (!tmp)
+ return -1;
+
+ wpa_debug_close_file();
+ rv = wpa_debug_open_file(tmp);
+ os_free(tmp);
return rv;
#else /* CONFIG_DEBUG_FILE */
return 0;