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:
Christian Kruse
2014-01-07 14:01:46 +01:00
parent 9209248420
commit b0cd2b5e43

View File

@@ -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;
}