Updated to hostap_2_6
[mech_eap.git] / libeap / src / utils / wpa_debug.c
index 7c72ea4..2983ad3 100644 (file)
@@ -148,7 +148,7 @@ int wpa_debug_open_linux_tracing(void)
                strtok_r(line, " ", &tmp2);
                tmp_path = strtok_r(NULL, " ", &tmp2);
                fstype = strtok_r(NULL, " ", &tmp2);
-               if (strcmp(fstype, "debugfs") == 0) {
+               if (fstype && strcmp(fstype, "debugfs") == 0) {
                        path = tmp_path;
                        break;
                }
@@ -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;