From e88a0757ab303ab27c7a092740b2382ae57740c9 Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Thu, 16 Jun 2022 02:02:18 +0200 Subject: [PATCH] storage: Log a message on network file parse errors Most users of storage_network_open don't log errors when the function returns a NULL and fall back to defaults (empty l_settings). storage_network_open() itself only logs errors if the flie is encrypted. Now also log an error when l_settings_load_from_file() fails to help track down potential syntax errors. --- src/storage.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/storage.c b/src/storage.c index 2100d08d..77be36c8 100644 --- a/src/storage.c +++ b/src/storage.c @@ -597,8 +597,10 @@ struct l_settings *storage_network_open(enum security type, const char *ssid) settings = l_settings_new(); - if (!l_settings_load_from_file(settings, path)) + if (!l_settings_load_from_file(settings, path)) { + l_error("Error loading %s", path); goto error; + } if (type != SECURITY_NONE && !storage_decrypt(settings, path, ssid)) goto error;