aboutsummaryrefslogtreecommitdiff
path: root/mfd/prog.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-03-10 09:33:39 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2009-03-10 09:33:39 +0000
commit267c3a787968c03c10d170562bbdec08df1d8fd0 (patch)
tree1a8529c0f76c92996b5ceb7955750cdb0bdb634d /mfd/prog.c
parent2122cadbd2d6c94c51f911947aa15060caa3a9fd (diff)
downloadmailfromd-267c3a787968c03c10d170562bbdec08df1d8fd0.tar.gz
mailfromd-267c3a787968c03c10d170562bbdec08df1d8fd0.tar.bz2
Bugfixes
* mfd/prog.c (env_capture_start): Do not create the stream if it already exists. Bug reported by Con Tassios. * mfd/bi_sieve.m4 (sieve): Don't free unexistend Sieve machines. * THANKS: Update * NEWS: Update git-svn-id: file:///svnroot/mailfromd/trunk@1777 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'mfd/prog.c')
-rw-r--r--mfd/prog.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/mfd/prog.c b/mfd/prog.c
index 943a7fc1..fe6d0378 100644
--- a/mfd/prog.c
+++ b/mfd/prog.c
@@ -2101,7 +2101,19 @@ env_get_context(eval_environ_t env)
int
env_capture_start(eval_environ_t env)
{
- int rc = mu_temp_file_stream_create(&env->stream, NULL);
+ int rc;
+
+ if (env->stream) {
+ rc = mu_stream_truncate(env->stream, 0);
+ if (rc == 0)
+ return 0;
+ /* If truncate fails, try to re-create the stream */
+ mu_stream_close(env->stream);
+ mu_stream_destroy(&env->stream,
+ mu_stream_get_owner(env->stream));
+ }
+
+ rc = mu_temp_file_stream_create(&env->stream, NULL);
if (rc) {
mu_error(_("%sCannot create temporary stream: %s"),
mailfromd_msgid(env->ctx), mu_strerror(rc));

Return to:

Send suggestions and report system problems to the System administrator.