dovecot-sieve-1.1: If script is compiled successfully, unlink .e...

dovecot at dovecot.org dovecot at dovecot.org
Sun Sep 30 17:34:14 EEST 2007


details:   http://hg.dovecot.org/dovecot-sieve-1.1/rev/48c4f168da70
changeset: 44:48c4f168da70
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Sep 30 17:34:11 2007 +0300
description:
If script is compiled successfully, unlink .err file.

diffstat:

1 file changed, 4 insertions(+), 1 deletion(-)
src/sieve-cmu.c |    5 ++++-

diffs (25 lines):

diff -r 485f4449e3ae -r 48c4f168da70 src/sieve-cmu.c
--- a/src/sieve-cmu.c	Sun Sep 30 17:33:38 2007 +0300
+++ b/src/sieve-cmu.c	Sun Sep 30 17:34:11 2007 +0300
@@ -879,6 +879,7 @@ dovecot_sieve_compile(script_data_t *sda
 		return -1;
 	}
 
+	temp_path = t_strconcat(script_path, ".err", NULL);
 	ret = sieve_script_parse(sdata->interp, f, sdata, &script);
 	if (ret != SIEVE_OK) {
 		if (sdata->errors == NULL) {
@@ -891,10 +892,12 @@ dovecot_sieve_compile(script_data_t *sda
 			       script_path,
 			       str_sanitize(str_c(sdata->errors), 80));
 		}
-		temp_path = t_strconcat(script_path, ".err", NULL);
 		dovecot_sieve_write_error_file(sdata, temp_path);
 		str_free(&sdata->errors);
 		return -1;
+	} else {
+		if (unlink(temp_path) < 0 && errno != ENOENT)
+			i_error("unlink(%s) failed: %m", temp_path);
 	}
 
 	if (sieve_generate_bytecode(&bc, script) < 0) {


More information about the dovecot-cvs mailing list