Mercurial > dovecot > core-2.2
changeset 18518:5d67814a596d
doveadm fs delete: Recent changes broke it completely.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 05 May 2015 13:13:42 +0300 |
parents | 986cbdfb887d |
children | 9b2b3c609367 |
files | src/doveadm/doveadm-fs.c |
diffstat | 1 files changed, 14 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/src/doveadm/doveadm-fs.c Mon May 04 23:27:42 2015 +0300 +++ b/src/doveadm/doveadm-fs.c Tue May 05 13:13:42 2015 +0300 @@ -224,7 +224,7 @@ struct fs_delete_ctx { unsigned int files_count; - struct fs_delete_file **files; + struct fs_delete_file *files; }; static bool cmd_fs_delete_ctx_run(struct fs_delete_ctx *ctx) @@ -233,20 +233,20 @@ bool ret = FALSE; for (i = 0; i < ctx->files_count; i++) { - if (ctx->files[i]->file == NULL || ctx->files[i]->finished) + if (ctx->files[i].file == NULL || ctx->files[i].finished) ; - else if (fs_delete(ctx->files[i]->file) == 0) { - fs_file_deinit(&ctx->files[i]->file); - ctx->files[i]->finished = TRUE; + else if (fs_delete(ctx->files[i].file) == 0) { + fs_file_deinit(&ctx->files[i].file); + ctx->files[i].finished = TRUE; } else if (errno == EAGAIN) ret = TRUE; else { i_error("fs_delete(%s) failed: %s", - fs_file_path(ctx->files[i]->file), - fs_file_last_error(ctx->files[i]->file)); + fs_file_path(ctx->files[i].file), + fs_file_last_error(ctx->files[i].file)); doveadm_exit_code = EX_TEMPFAIL; - fs_file_deinit(&ctx->files[i]->file); - ctx->files[i]->finished = TRUE; + fs_file_deinit(&ctx->files[i].file); + ctx->files[i].finished = TRUE; } } return ret; @@ -264,7 +264,7 @@ memset(&ctx, 0, sizeof(ctx)); ctx.files_count = I_MAX(async_count, 1); - ctx.files = t_new(struct fs_delete_file *, ctx.files_count); + ctx.files = t_new(struct fs_delete_file, ctx.files_count); /* delete subdirs first. all fs backends can't handle recursive lookups, so save the list first. */ @@ -309,11 +309,10 @@ fname = *fnamep; retry: for (i = 0; i < ctx.files_count; i++) { - if (ctx.files[i]->file != NULL || - ctx.files[i]->finished) + if (ctx.files[i].file != NULL || ctx.files[i].finished) continue; - ctx.files[i]->file = fs_file_init(fs, + ctx.files[i].file = fs_file_init(fs, t_strdup_printf("%s%s", path_prefix, fname), FS_OPEN_MODE_READONLY | FS_OPEN_FLAG_ASYNC | FS_OPEN_FLAG_ASYNC_NOQUEUE); @@ -338,8 +337,8 @@ } } for (i = 0; i < ctx.files_count; i++) { - if (ctx.files[i]->file != NULL) - fs_file_deinit(&ctx.files[i]->file); + if (ctx.files[i].file != NULL) + fs_file_deinit(&ctx.files[i].file); } }