aboutsummaryrefslogtreecommitdiff
path: root/mfd/prog.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-03-12 21:55:08 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2009-03-12 21:55:08 +0000
commitc63d563fc199d3234a4ceb7dbb343ba749da7353 (patch)
treee85c2901a521bfc772801bfc4886fefcb32b21b0 /mfd/prog.c
parent07336ea55b20a411f86bef4133c3a8988d229922 (diff)
downloadmailfromd-c63d563fc199d3234a4ceb7dbb343ba749da7353.tar.gz
mailfromd-c63d563fc199d3234a4ceb7dbb343ba749da7353.tar.bz2
Fix the current_message function and subprocess handling in mtasim.
* mtasim/mtasim.c (stop_mailfromd): Wait for the mailfromd child to terminate and analyze its return status. * mfd/bi_msg.m4 (bi_drop_current_message): New function. * mfd/prog.c (env_capture_start): Call bi_drop_current_message if the capture stream already exists (i.e. when starting processing 2nd or later message in a session). * mfd/msg.h (bi_drop_current_message): New prototype. * gacopyz/server.c (srv_connect): Retry attempts to connect if they fail with ECONNREFUSED. Implement 5-second timeout. * tests/testsuite.at (MAILFROMD_OPTIONS): New define. (AT_MTA_TEST): Pass MAILFROMD_OPTIONS to mtasim invocation. (AT_WITH_MAILFROMD_OPTIONS): New macro. Include curmsg.at. * tests/curmsg.at: New file * tests/etc/Makefile.am (RCFILES): Add size.rc * tests/etc/size.rc: New file git-svn-id: file:///svnroot/mailfromd/trunk@1779 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'mfd/prog.c')
-rw-r--r--mfd/prog.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mfd/prog.c b/mfd/prog.c
index dc5c4187..73ffffc7 100644
--- a/mfd/prog.c
+++ b/mfd/prog.c
@@ -31,6 +31,7 @@
#include <syslog.h>
#include "mailfromd.h"
#include "prog.h"
+#include "msg.h"
#include "optab.h"
#define DEFINE_BUILTIN_MODULE
#include "builtin.h"
@@ -2105,6 +2106,11 @@ env_capture_start(eval_environ_t env)
int rc;
if (env->stream) {
+ /* Drop any previously registered current message */
+ bi_drop_current_message(env);
+
+ /* Truncate existing stream and reposition to its
+ beginning */
rc = mu_stream_truncate(env->stream, 0);
if (rc == 0 && mu_stream_seek(env->stream, 0, SEEK_SET) == 0)
return 0;

Return to:

Send suggestions and report system problems to the System administrator.