1 message in net.sourceforge.lists.courier-sqwebmail[sqwebmail] Re: another 64 bits off_t...
FromSent OnAttachments
Brian CandlerNov 10, 2004 7:51 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[sqwebmail] Re: another 64 bits off_t issueActions...
From:Brian Candler (B.Ca@pobox.com)
Date:Nov 10, 2004 7:51:05 am
List:net.sourceforge.lists.courier-sqwebmail

On i386 FreeBSD, off_t are 64 bits length but long are 32 bits. When deleting a message, the maildirsize file appear to be buggy :

1048576S 406705 103 4294966144 -1

It"s fixed with the following patch (it apply on 4.0.6 but the wrong cast is still here in the CVS version) :

--- maildir.c.orig.2 Mon Nov 8 12:45:10 2004 +++ maildir.c Mon Nov 8 12:46:11 2004 @@ -893,7 +893,7 @@ {

if (!from_shared) - maildir_quota_deleted(".", -filesize, -1); + maildir_quota_deleted(".", -(off_t)filesize, -1); } else if (!dest_shared && maildirquota_countfolder(destdir) && (from_shared || !maildirquota_countfolder(fromdir))

If the problem is how you describe it, then it's a bit strange.

Because the prototype for maildir_quota_deleted declares its second argument as an off_t, then the expression should automatically be automatically cast to off_t by the compiler - unless the prototype has not been seen, in which case you should get a compiler warning.

I'm looking in sqwebmail-4.0.7.20041103, and I see that maildir/maildir.c has

#include "maildir/maildirquota.h"

and in that file is the prototype:

void maildir_quota_deleted(const char *maildir, off_t nbytes, /* Must be negative */ int nmsgs); /* Must be negative */

I've checked that 4.0.6 is the same. Also, I don't get any compiler warning when building.

If off_t were unsigned that might explain it, but it shouldn't be, and on my box (FreeBSD 5.2.1) I have typedef __int64_t __off_t in sys/_types.h.

So are you *sure* that this change actually cures the problem you've seen? Because I don't think it should - and therefore I would expect that the problem actually lies somewhere else in the code.

It is certainly strange that you end up with -1 files in the directory though... do you have another application (which is not maildirsize aware) adding or deleting files from the Maildir?

Regards,

Brian.