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

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