Skip to content

Commit

Permalink
MDEV-18204 - fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
vaintroub committed Feb 19, 2019
1 parent e3f6ea5 commit d2fc9d0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
22 changes: 11 additions & 11 deletions extra/mariabackup/backup_copy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1633,21 +1633,21 @@ ibx_copy_incremental_over_full()
}
}

}

if (directory_exists(ROCKSDB_BACKUP_DIR, false)) {
if (my_rmtree(ROCKSDB_BACKUP_DIR, MYF(0))) {
die("Can't remove " ROCKSDB_BACKUP_DIR);
if (directory_exists(ROCKSDB_BACKUP_DIR, false)) {
if (my_rmtree(ROCKSDB_BACKUP_DIR, MYF(0))) {
die("Can't remove " ROCKSDB_BACKUP_DIR);
}
}
}
snprintf(path, sizeof(path), "%s/" ROCKSDB_BACKUP_DIR, xtrabackup_incremental_dir);
if (directory_exists(path, false)) {
if (my_mkdir(ROCKSDB_BACKUP_DIR, 0777, MYF(0))) {
die("my_mkdir failed for " ROCKSDB_BACKUP_DIR);
snprintf(path, sizeof(path), "%s/" ROCKSDB_BACKUP_DIR, xtrabackup_incremental_dir);
if (directory_exists(path, false)) {
if (my_mkdir(ROCKSDB_BACKUP_DIR, 0777, MYF(0))) {
die("my_mkdir failed for " ROCKSDB_BACKUP_DIR);
}
copy_or_move_dir(path, ROCKSDB_BACKUP_DIR, true, true);
}
copy_or_move_dir(path, ROCKSDB_BACKUP_DIR, true, true);
}


cleanup:
if (it != NULL) {
datadir_iter_free(it);
Expand Down
3 changes: 2 additions & 1 deletion mysys/my_delete.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,13 @@ int my_rmtree(const char *dir, myf MyFlags)
char path[FN_REFLEN];
char sep[] = { FN_LIBCHAR, 0 };
int err = 0;
uint i;

MY_DIR *dir_info = my_dir(dir, MYF(MY_DONT_SORT | MY_WANT_STAT));
if (!dir_info)
return 1;

for (uint i = 0; i < dir_info->number_of_files; i++)
for (i = 0; i < dir_info->number_of_files; i++)
{
FILEINFO *file = dir_info->dir_entry + i;
/* Skip "." and ".." */
Expand Down

0 comments on commit d2fc9d0

Please sign in to comment.