changeset 284:324780ed8d85

Clean up sub/unsub confirmation requests Add return value check to writen in do_all...
author mmj
date Wed, 30 Jun 2004 00:09:59 +1000
parents a76b0b551ad0
children 081ba983e6f1
files src/do_all_the_voodo_here.c src/mlmmj-maintd.c
diffstat 2 files changed, 34 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/do_all_the_voodo_here.c	Wed Jun 30 00:09:33 2004 +1000
+++ b/src/do_all_the_voodo_here.c	Wed Jun 30 00:09:59 2004 +1000
@@ -95,7 +95,12 @@
 					return -1;
 				}
 			}
-			writen(outfd, hdrline, strlen(hdrline));
+			if(writen(outfd, hdrline, strlen(hdrline)) < 0) {
+				myfree(hdrline);
+				log_error(LOG_ARGS, "Error writing hdrs.");
+				return -1;
+			}
+			
 			fsync(outfd);
 			myfree(hdrline);
 			break;
--- a/src/mlmmj-maintd.c	Wed Jun 30 00:09:33 2004 +1000
+++ b/src/mlmmj-maintd.c	Wed Jun 30 00:09:59 2004 +1000
@@ -107,6 +107,26 @@
 	return ret;
 }
 
+int clean_subconf(const char *listdir)
+{
+	char *subconfdirname = concatstr(2, listdir, "/subconf");
+	int ret = delolder(subconfdirname, CONFIRMLIFE);
+
+	myfree(subconfdirname);
+
+	return ret;
+}
+
+int clean_unsubconf(const char *listdir)
+{
+	char *unsubconfdirname = concatstr(2, listdir, "/unsubconf");
+	int ret = delolder(unsubconfdirname, CONFIRMLIFE);
+
+	myfree(unsubconfdirname);
+
+	return ret;
+}
+
 int discardmail(const char *old, const char *new, time_t age)
 {
 	struct stat st;
@@ -734,7 +754,7 @@
 
 	for(;;) {
 		random = random_str();
-		logname = concatstr(3, listdir, "maintdlog-", random);
+		logname = concatstr(3, listdir, "/maintdlog-", random);
 		myfree(random);
 		maintdlogfd = open(logname, O_WRONLY|O_EXCL|O_CREAT,
 					S_IRUSR|S_IWUSR);
@@ -750,6 +770,12 @@
 		WRITEMAINTLOG4(3, "clean_discarded(", listdir, ");\n");
 		clean_discarded(listdir);
 
+		WRITEMAINTLOG4(3, "clean_subconf(", listdir, ");\n");
+		clean_subconf(listdir);
+
+		WRITEMAINTLOG4(3, "clean_unsubconf(", listdir, ");\n");
+		clean_unsubconf(listdir);
+
 		WRITEMAINTLOG6(5, "resend_queue(", listdir, ", ", mlmmjsend,
 							");\n");
 		resend_queue(listdir, mlmmjsend);