This is an automated email from the git hooks/post-receive script.
rharwood pushed a commit to branch master in repository gssproxy.
commit 5da58d18668b3e6ce175ad3d4f74a357c31784de Author: Robbie Harwood rharwood@redhat.com Date: Tue Feb 21 17:24:48 2017 -0500
Fix behavior when not passed config_dir on the command line
Signed-off-by: Robbie Harwood rharwood@redhat.com Reviewed-by: Simo Sorce simo@redhat.com --- proxy/src/gp_config.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/proxy/src/gp_config.c b/proxy/src/gp_config.c index cf1c08b..184f59e 100644 --- a/proxy/src/gp_config.c +++ b/proxy/src/gp_config.c @@ -612,7 +612,7 @@ struct gp_config *read_config(char *config_file, char *config_dir, char *socket_name, int opt_daemonize) { const char *socket = GP_SOCKET_NAME; - const char *dir = PUBCONF_PATH; + const char *dir = NULL; struct gp_config *cfg; int ret;
@@ -634,12 +634,18 @@ struct gp_config *read_config(char *config_file, char *config_dir, } }
- if (config_dir) dir = config_dir; + if (config_dir) { + dir = config_dir; + } else if (!config_file) { + dir = PUBCONF_PATH; + }
- cfg->config_dir = strdup(dir); - if (!cfg->config_dir) { - ret = ENOMEM; - goto done; + if (dir) { + cfg->config_dir = strdup(dir); + if (!cfg->config_dir) { + ret = ENOMEM; + goto done; + } }
if (socket_name) socket = socket_name;