changeset 139:fb077a8016de

append to subscribers file and not archive before last mlmmj-send is done.
author mmj
date Wed, 02 Jun 2004 08:03:06 +1000
parents c6331d91a32f
children a79d22b050e6
files src/mlmmj-send.c
diffstat 1 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/mlmmj-send.c	Wed Jun 02 06:10:14 2004 +1000
+++ b/src/mlmmj-send.c	Wed Jun 02 08:03:06 2004 +1000
@@ -315,9 +315,9 @@
 			}
 			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 @@
 		break;
 	}
 	
+	while(conncount)
+		sleep(1);
+
 	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. */
-
 		rename(mailfilename, archivefilename);
 
 		free(archivefilename);