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

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