Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: The init command fails without an error message. #561

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,31 @@ do_init(CatalogState *catalogState)
}

/* create backup catalog root directory */
dir_create_dir(catalogState->catalog_path, DIR_PERMISSION, false);
results = dir_create_dir(catalogState->catalog_path, DIR_PERMISSION, false);
if(results != 0)
{
int errno_tmp = errno;
elog(ERROR, "cannot create backup catalog root directory \"%s\": %s",
catalogState->catalog_path, strerror(errno_tmp));
}

/* create backup catalog data directory */
dir_create_dir(catalogState->backup_subdir_path, DIR_PERMISSION, false);
results = dir_create_dir(catalogState->backup_subdir_path, DIR_PERMISSION, false);
if(results != 0)
{
int errno_tmp = errno;
elog(ERROR, "cannot create backup catalog data directory \"%s\": %s",
catalogState->backup_subdir_path, strerror(errno_tmp));
}

/* create backup catalog wal directory */
dir_create_dir(catalogState->wal_subdir_path, DIR_PERMISSION, false);
results = dir_create_dir(catalogState->wal_subdir_path, DIR_PERMISSION, false);
if(results != 0)
{
int errno_tmp = errno;
elog(ERROR, "cannot create backup catalog wal directory \"%s\": %s",
catalogState->wal_subdir_path, strerror(errno_tmp));
}

elog(INFO, "Backup catalog '%s' successfully inited", catalogState->catalog_path);
return 0;
Expand Down