[leafnode-list] leafnode-1.10.x texpire "relinked message" problem

Matthias Andree matthias.andree at gmx.de
Wed Aug 4 17:27:44 CEST 2004


On Wed, 04 Aug 2004, Rein Klazes wrote:

> On Wed, 04 Aug 2004 13:20:12 +0200, you wrote:
> 
> > > Any suggestion where the fault might be?
> > 
> > No idea. Try this patch,
> 
> Which patch?

Whoops.


Index: log_unlink.c
===================================================================
RCS file: /var/CVS/leafnode-1/log_unlink.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- log_unlink.c	10 Jan 2003 00:59:37 -0000	1.1
+++ log_unlink.c	4 Aug 2004 11:21:26 -0000	1.2
@@ -17,5 +17,9 @@
 	r = 0;
     if (r < 0)
 	ln_log(LNLOG_SERR, LNLOG_CTOP, "cannot unlink %s: %m", f);
+    else {
+	if (debugmode)
+	    ln_log(LNLOG_SDEBUG, LNLOG_CTOP, "unlinked %s");
+    }
     return r;
 }
Index: texpire.c
===================================================================
RCS file: /var/CVS/leafnode-1/texpire.c,v
retrieving revision 1.62
diff -u -r1.62 texpire.c
--- texpire.c	7 Jul 2004 18:07:39 -0000	1.62
+++ texpire.c	4 Aug 2004 11:18:35 -0000
@@ -591,7 +591,14 @@
 	    continue;
 	while ((de = readdir(d)) != 0) {
 	    if (stat(de->d_name, &st) == 0 && S_ISREG(st.st_mode)) {
-		if (st.st_nlink < 2 || (!nomids && !findmsgid(de->d_name))) {
+		int ul = 0;
+		char *reason = "";
+		if (st.st_nlink < 2) ul = 1, reason = "link count below 1";
+		if (!nomids && !findmsgid(de->d_name)) ul = 1, reason = "not seen in group scan";
+		if (ul) {
+		    if (debugmode)
+			ln_log(LNLOG_SDEBUG, LNLOG_CARTICLE, "unlinked %03d/%s, %s",
+				n, de->d_name, reason);
 		    if (0 == log_unlink(de->d_name, 1)
 			    && de->d_name[0] == '<' /* only count MID files */)
 			deleted++;


-- 
Matthias Andree

Encrypted mail welcome: my GnuPG key ID is 0x052E7D95 (PGP/MIME preferred)



More information about the leafnode-list mailing list