summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-04-10 19:33:18 -0400
committerJune McEnroe <june@causal.agency>2020-04-10 19:33:18 -0400
commit1dd6103723f8e46c7032b38f74193df0cb649df4 (patch)
tree31226dad12ccc6dac51d6649d514a84cf9132a61
parentUse hard links for single-message mbox threads (diff)
downloadbubger-1dd6103723f8e46c7032b38f74193df0cb649df4.tar.gz
bubger-1dd6103723f8e46c7032b38f74193df0cb649df4.zip
Revert "Use hard links for single-message mbox threads"
This reverts commit 71d7aada572a6c2751d82f45869006c8a7be72c1.

If the thread later has more messages in it, opening the link with mode
"w" will also replace the contents of the linked file.
-rw-r--r--concat.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/concat.c b/concat.c
index 45ce12d..eeab073 100644
--- a/concat.c
+++ b/concat.c
@@ -22,7 +22,6 @@
 #include <stdlib.h>
 #include <sys/stat.h>
 #include <sysexits.h>
-#include <unistd.h>
 
 #include "archive.h"
 #include "imap.h"
@@ -117,12 +116,7 @@ void concatData(struct List threads, struct List items) {
 
 	path = threadPath(envelope.messageID, "mbox");
 	error = stat(path, &file);
-	if (error && flat.len == 1) {
-		uint32_t uid = dataCheck(flat.ptr[0], Number).number;
-		error = link(uidPath(uid, "mbox"), path);
-		if (error) err(EX_CANTCREAT, "%s", path);
-
-	} else if (error || file.st_mtime < uidNewest(flat, "mbox")) {
+	if (error || file.st_mtime < uidNewest(flat, "mbox")) {
 		FILE *mbox = fopen(path, "w");
 		if (!mbox) err(EX_CANTCREAT, "%s", path);