dovecot-2.2: doveadm fs delete: Recent changes broke it completely.

dovecot at dovecot.org dovecot at dovecot.org
Tue May 5 10:15:30 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/5d67814a596d
changeset: 18518:5d67814a596d
user:      Timo Sirainen <tss at iki.fi>
date:      Tue May 05 13:13:42 2015 +0300
description:
doveadm fs delete: Recent changes broke it completely.

diffstat:

 src/doveadm/doveadm-fs.c |  29 ++++++++++++++---------------
 1 files changed, 14 insertions(+), 15 deletions(-)

diffs (75 lines):

diff -r 986cbdfb887d -r 5d67814a596d src/doveadm/doveadm-fs.c
--- 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);
 	}
 }
 


More information about the dovecot-cvs mailing list