summaryrefslogtreecommitdiff
path: root/extra/mariabackup/datasink.h
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2021-03-31 14:23:56 +0200
committerVladislav Vaintroub <wlad@mariadb.com>2021-03-31 14:23:56 +0200
commit08cb5d848314006111b0c379db6a1fce220579aa (patch)
tree4ec72ec98bd35530d8e21924b511d15f87e588ff /extra/mariabackup/datasink.h
parent35ee4aa4e3bf391b7de78b3e95f3e484394fd1ac (diff)
downloadmariadb-git-08cb5d848314006111b0c379db6a1fce220579aa.tar.gz
MDEV-25221 Do not remove source file, if copy_file() fails in mariabackup --move-back
Remove an incompletely copied destination file.
Diffstat (limited to 'extra/mariabackup/datasink.h')
-rw-r--r--extra/mariabackup/datasink.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/extra/mariabackup/datasink.h b/extra/mariabackup/datasink.h
index 201bbfd3267..5c82556b9ba 100644
--- a/extra/mariabackup/datasink.h
+++ b/extra/mariabackup/datasink.h
@@ -50,9 +50,15 @@ struct datasink_struct {
ds_file_t *(*open)(ds_ctxt_t *ctxt, const char *path, MY_STAT *stat);
int (*write)(ds_file_t *file, const unsigned char *buf, size_t len);
int (*close)(ds_file_t *file);
+ int (*remove)(const char *path);
void (*deinit)(ds_ctxt_t *ctxt);
};
+
+static inline int dummy_remove(const char *) {
+ return 0;
+}
+
/* Supported datasink types */
typedef enum {
DS_TYPE_STDOUT,