diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-03-10 09:33:39 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-03-10 09:33:39 +0000 |
commit | 267c3a787968c03c10d170562bbdec08df1d8fd0 (patch) | |
tree | 1a8529c0f76c92996b5ceb7955750cdb0bdb634d /mfd/prog.c | |
parent | 2122cadbd2d6c94c51f911947aa15060caa3a9fd (diff) | |
download | mailfromd-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.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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)); |