]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
settings: Reduce log verbosity if strongswan.conf does not exist
authorTobias Brunner <tobias@strongswan.org>
Mon, 31 Mar 2014 12:47:00 +0000 (14:47 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 31 Mar 2014 14:40:04 +0000 (16:40 +0200)
In some situations we expect strongswan.conf to not exist, for instance,
when running the unit tests before installation.

src/libstrongswan/utils/settings.c

index 0d8ce3200838e0924f36cf4d9996362b0371cf4b..cf34fd1cf0c9f8f3124377867ba5de983c4e1de2 100644 (file)
@@ -1224,7 +1224,16 @@ static bool parse_file(linked_list_t *contents, char *file, int level,
        {
                if (errno == ENOENT)
                {
-                       DBG1(DBG_LIB, "'%s' does not exist, ignored", file);
+#ifdef STRONGSWAN_CONF
+                       if (streq(file, STRONGSWAN_CONF))
+                       {
+                               DBG2(DBG_LIB, "'%s' does not exist, ignored", file);
+                       }
+                       else
+#endif
+                       {
+                               DBG1(DBG_LIB, "'%s' does not exist, ignored", file);
+                       }
                        return TRUE;
                }
                DBG1(DBG_LIB, "failed to stat '%s': %s", file, strerror(errno));