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>
This commit is contained in:
parent
67deaa582d
commit
d8fd633ebb
1 changed files with 12 additions and 10 deletions
|
@ -517,16 +517,18 @@ int wpa_debug_reopen_file(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_DEBUG_FILE
|
#ifdef CONFIG_DEBUG_FILE
|
||||||
int rv;
|
int rv;
|
||||||
if (last_path) {
|
char *tmp;
|
||||||
char *tmp = os_strdup(last_path);
|
|
||||||
wpa_debug_close_file();
|
if (!last_path)
|
||||||
rv = wpa_debug_open_file(tmp);
|
return 0; /* logfile not used */
|
||||||
os_free(tmp);
|
|
||||||
} else {
|
tmp = os_strdup(last_path);
|
||||||
wpa_printf(MSG_ERROR, "Last-path was not set, cannot "
|
if (!tmp)
|
||||||
"re-open log file.");
|
return -1;
|
||||||
rv = -1;
|
|
||||||
}
|
wpa_debug_close_file();
|
||||||
|
rv = wpa_debug_open_file(tmp);
|
||||||
|
os_free(tmp);
|
||||||
return rv;
|
return rv;
|
||||||
#else /* CONFIG_DEBUG_FILE */
|
#else /* CONFIG_DEBUG_FILE */
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue