From b0cd2b5e43ebf5631c5699932d4b438470ccad1a Mon Sep 17 00:00:00 2001 From: Christian Kruse Date: Tue, 7 Jan 2014 14:01:46 +0100 Subject: [PATCH] fix: do not exit() in create_pgdir() This could leave the database in a locked state (pg_start_backup()). And since all calls to create_pgdir() handle the return value correctly we simply replace the exit() by a return false --- check_dir.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/check_dir.c b/check_dir.c index 5ae4c096..11aa56bb 100644 --- a/check_dir.c +++ b/check_dir.c @@ -256,7 +256,7 @@ create_pgdir(char *dir, bool force) { log_err(_("couldn't create directory \"%s\"...\n"), dir); - exit(ERR_BAD_CONFIG); + return false; } break; case 1: @@ -268,7 +268,7 @@ create_pgdir(char *dir, bool force) { log_err(_("could not change permissions of directory \"%s\": %s\n"), dir, strerror(errno)); - exit(ERR_BAD_CONFIG); + return false; } break; case 2: @@ -293,7 +293,7 @@ create_pgdir(char *dir, bool force) "If you are sure you want to clone here, " "please check there is no PostgreSQL server " "running and use the --force option\n")); - exit(ERR_BAD_CONFIG); + return false; } return false; @@ -301,7 +301,7 @@ create_pgdir(char *dir, bool force) /* Trouble accessing directory */ log_err(_("could not access directory \"%s\": %s\n"), dir, strerror(errno)); - exit(ERR_BAD_CONFIG); + return false; } return true; }