diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2019-02-19 07:31:25 +0100 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2019-02-19 07:31:25 +0100 |
commit | d2fc9d09da007d41d83e9e29a9f2911eb7f8feee (patch) | |
tree | bb8eef8b7c97a8610829f36175694c840b10932f | |
parent | e3f6ea5080cd59299afb110619791bc881ea36ac (diff) | |
download | mariadb-git-d2fc9d09da007d41d83e9e29a9f2911eb7f8feee.tar.gz |
MDEV-18204 - fixup
-rw-r--r-- | extra/mariabackup/backup_copy.cc | 22 | ||||
-rw-r--r-- | mysys/my_delete.c | 3 |
2 files changed, 13 insertions, 12 deletions
diff --git a/extra/mariabackup/backup_copy.cc b/extra/mariabackup/backup_copy.cc index bd2f28baa92..0059ae5b16a 100644 --- a/extra/mariabackup/backup_copy.cc +++ b/extra/mariabackup/backup_copy.cc @@ -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); diff --git a/mysys/my_delete.c b/mysys/my_delete.c index cff107508d4..a816d972d29 100644 --- a/mysys/my_delete.c +++ b/mysys/my_delete.c @@ -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 ".." */ |