From: Ben Greear Date: Sat, 4 Aug 2012 17:38:50 +0000 (+0300) Subject: Add some debug info for config file error cases X-Git-Tag: hostap_2_0~503 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=mech_eap.git;a=commitdiff_plain;h=481cac211e6badb2042ba278b8c47bff45439e5b Add some debug info for config file error cases It didn't always spit out useful stuff when reading config failed. Signed-off-by: Ben Greear --- diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c index 0520646..32d416e 100644 --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c @@ -323,11 +323,17 @@ struct wpa_config * wpa_config_read(const char *name) int cred_id = 0; config = wpa_config_alloc_empty(NULL, NULL); - if (config == NULL) + if (config == NULL) { + wpa_printf(MSG_ERROR, "Failed to allocate config file " + "structure"); return NULL; + } + wpa_printf(MSG_DEBUG, "Reading configuration file '%s'", name); f = fopen(name, "r"); if (f == NULL) { + wpa_printf(MSG_ERROR, "Failed to open config file '%s', " + "error: %s", name, strerror(errno)); os_free(config); return NULL; } @@ -372,6 +378,8 @@ struct wpa_config * wpa_config_read(const char *name) } else if (os_strncmp(pos, "blob-base64-", 12) == 0) { if (wpa_config_process_blob(config, f, &line, pos + 12) < 0) { + wpa_printf(MSG_ERROR, "Line %d: failed to " + "process blob.", line); errors++; continue; }