Commit d2fc9d09 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-18204 - fixup

parent e3f6ea50
...@@ -1633,21 +1633,21 @@ ibx_copy_incremental_over_full() ...@@ -1633,21 +1633,21 @@ ibx_copy_incremental_over_full()
} }
} }
} if (directory_exists(ROCKSDB_BACKUP_DIR, false)) {
if (my_rmtree(ROCKSDB_BACKUP_DIR, MYF(0))) {
if (directory_exists(ROCKSDB_BACKUP_DIR, false)) { die("Can't remove " ROCKSDB_BACKUP_DIR);
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);
snprintf(path, sizeof(path), "%s/" ROCKSDB_BACKUP_DIR, xtrabackup_incremental_dir); if (directory_exists(path, false)) {
if (directory_exists(path, false)) { if (my_mkdir(ROCKSDB_BACKUP_DIR, 0777, MYF(0))) {
if (my_mkdir(ROCKSDB_BACKUP_DIR, 0777, MYF(0))) { die("my_mkdir failed for " ROCKSDB_BACKUP_DIR);
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: cleanup:
if (it != NULL) { if (it != NULL) {
datadir_iter_free(it); datadir_iter_free(it);
......
...@@ -170,12 +170,13 @@ int my_rmtree(const char *dir, myf MyFlags) ...@@ -170,12 +170,13 @@ int my_rmtree(const char *dir, myf MyFlags)
char path[FN_REFLEN]; char path[FN_REFLEN];
char sep[] = { FN_LIBCHAR, 0 }; char sep[] = { FN_LIBCHAR, 0 };
int err = 0; int err = 0;
uint i;
MY_DIR *dir_info = my_dir(dir, MYF(MY_DONT_SORT | MY_WANT_STAT)); MY_DIR *dir_info = my_dir(dir, MYF(MY_DONT_SORT | MY_WANT_STAT));
if (!dir_info) if (!dir_info)
return 1; 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; FILEINFO *file = dir_info->dir_entry + i;
/* Skip "." and ".." */ /* Skip "." and ".." */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment