Blame SOURCES/Fix-segfault-when-no-config-files-are-present.patch

1f3433
From 76954aa028a897021a9bdcb0a1b5249e2652f7b6 Mon Sep 17 00:00:00 2001
1f3433
From: Robbie Harwood <rharwood@redhat.com>
1f3433
Date: Tue, 16 May 2017 14:16:23 -0400
1f3433
Subject: [PATCH] Fix segfault when no config files are present
1f3433
1f3433
Resolves: rhbz#1451255
1f3433
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
1f3433
Reviewed-by: Simo Sorce <simo@redhat.com>
1f3433
Merges: #185
1f3433
(cherry picked from commit df434333de34a13440857b511a4c60fbc6a71a5c)
1f3433
---
1f3433
 proxy/src/gp_config.c | 7 ++++---
1f3433
 1 file changed, 4 insertions(+), 3 deletions(-)
1f3433
1f3433
diff --git a/proxy/src/gp_config.c b/proxy/src/gp_config.c
1f3433
index b4ab90c..8fd60a3 100644
1f3433
--- a/proxy/src/gp_config.c
1f3433
+++ b/proxy/src/gp_config.c
1f3433
@@ -844,16 +844,17 @@ int gp_config_init(const char *config_file, const char *config_dir,
1f3433
 
1f3433
     if (config_file) {
1f3433
         ret = gp_config_from_file(config_file, ini_config, collision_flags);
1f3433
-        if (ret == ENOENT) {
1f3433
-            GPDEBUG("Expected config file %s but did not find it.\n",
1f3433
+        if (ret) {
1f3433
+            GPDEBUG("Error when trying to read config file %s.\n",
1f3433
                     config_file);
1f3433
-        } else if (ret) {
1f3433
             return ret;
1f3433
         }
1f3433
     }
1f3433
     if (config_dir) {
1f3433
         ret = gp_config_from_dir(config_dir, &ini_config, collision_flags);
1f3433
         if (ret) {
1f3433
+            GPDEBUG("Error when trying to read config directory %s.\n",
1f3433
+                    config_dir);
1f3433
             return ret;
1f3433
         }
1f3433
     }