diff src/lib-storage/index/cydir/cydir-save.c @ 6940:414c9d631a81 HEAD

Replaced t_push/t_pop calls with T_FRAME*() macros.
author Timo Sirainen <tss@iki.fi>
date Wed, 05 Dec 2007 17:47:44 +0200
parents 9ca7f055b646
children 7ed926ed7aa4
line wrap: on
line diff
--- a/src/lib-storage/index/cydir/cydir-save.c	Wed Dec 05 17:47:19 2007 +0200
+++ b/src/lib-storage/index/cydir/cydir-save.c	Wed Dec 05 17:47:44 2007 +0200
@@ -70,7 +70,6 @@
 	struct cydir_save_context *ctx = t->save_ctx;
 	enum mail_flags save_flags;
 	struct istream *crlf_input;
-	const char *path;
 
 	i_assert((t->ictx.flags & MAILBOX_TRANSACTION_FLAG_EXTERNAL) != 0);
 
@@ -82,20 +81,23 @@
 		ctx->tmp_basename = cydir_generate_tmp_filename();
 	}
 
-	t_push();
-	path = cydir_get_save_path(ctx, ctx->mail_count);
-	ctx->fd = open(path, O_WRONLY | O_CREAT | O_EXCL, 0660);
-	if (ctx->fd != -1) {
-		ctx->output = o_stream_create_fd_file(ctx->fd, 0, FALSE);
-		o_stream_cork(ctx->output);
-	} else {
-		mail_storage_set_critical(_t->box->storage,
-					  "open(%s) failed: %m", path);
-		ctx->failed = TRUE;
-		t_pop();
+	T_FRAME(
+		const char *path;
+
+		path = cydir_get_save_path(ctx, ctx->mail_count);
+		ctx->fd = open(path, O_WRONLY | O_CREAT | O_EXCL, 0660);
+		if (ctx->fd != -1) {
+			ctx->output =
+				o_stream_create_fd_file(ctx->fd, 0, FALSE);
+			o_stream_cork(ctx->output);
+		} else {
+			mail_storage_set_critical(_t->box->storage,
+						  "open(%s) failed: %m", path);
+			ctx->failed = TRUE;
+		}
+	);
+	if (ctx->failed)
 		return -1;
-	}
-	t_pop();
 
 	/* add to index */
 	save_flags = flags & ~MAIL_RECENT;