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