From: mmj Date: Tue, 1 Jun 2004 22:03:06 +0000 (+1000) Subject: append to subscribers file and not archive before last mlmmj-send is done. X-Git-Tag: RELEASE_1_0_0~190 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4dbf72acc0aa41e45a2408d78e9e348ad5851fa;p=thirdparty%2Fmlmmj.git append to subscribers file and not archive before last mlmmj-send is done. --- diff --git a/src/mlmmj-send.c b/src/mlmmj-send.c index b45210ce..2ca5cb17 100644 --- a/src/mlmmj-send.c +++ b/src/mlmmj-send.c @@ -315,9 +315,9 @@ int send_mail_many(int sockfd, const char *from, const char *replyto, } addrfilename = concatstr(2, dirname, "/subscribers"); free(dirname); - addrfile = fopen(addrfilename, "w"); + addrfile = fopen(addrfilename, "a"); if(addrfile == NULL) { - log_error(LOG_ARGS, "Could not create %s", + log_error(LOG_ARGS, "Could not write to %s", addrfilename); free(addrfilename); free(addr); @@ -599,12 +599,10 @@ int main(int argc, char **argv) break; } - if(archive) { - /* It is safe to rename() the mail file at this point, because - the child processes (who might still be running) inherit a - handle to the open file, so they don't care if it is moved - or deleted. */ + while(conncount) + sleep(1); + if(archive) { rename(mailfilename, archivefilename); free(archivefilename);