mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user