On Mon, Jul 13, 2009 at 10:12:53AM +0200, Oswald Buddenhagen wrote:
> hi,
> 
> On Sun, Jul 12, 2009 at 10:41:46PM +0200, Antoine Reilles wrote:
> > Recently, time_t was made 64bits under NetBSD.
> > With this change, isync does segfault in drv_maildir, when it tries to
> > print the result of time(0) with %ld.
> > 
> oh
> 
> > The attached patch does fix this segfault, and dit let isync work again
> > for me.
> > 
> which patch? ;)

Oh, forgot to add it, sorry

antoine
$NetBSD: patch-af,v 1.4 2009/07/12 20:26:59 tonio Exp $

time_t may be 64bits

--- src/drv_maildir.c.orig      2008-02-23 10:02:21.000000000 +0100
+++ src/drv_maildir.c
@@ -936,7 +936,7 @@ maildir_store_msg( store_t *gctx, msg_da
        int ret, fd, bl;
        char buf[_POSIX_PATH_MAX], nbuf[_POSIX_PATH_MAX], fbuf[NUM_FLAGS + 3], 
base[128];
 
-       bl = nfsnprintf( base, sizeof(base), "%ld.%d_%d.%s", time( 0 ), Pid, 
++MaildirCount, Hostname );
+       bl = nfsnprintf( base, sizeof(base), "%lld.%d_%d.%s", (long long int) 
time( 0 ), Pid, ++MaildirCount, Hostname );
        if (uid) {
 #ifdef USE_DB
                if (ctx->db) {
@@ -1086,8 +1086,8 @@ maildir_trash_msg( store_t *gctx, messag
        for (;;) {
                nfsnprintf( buf, sizeof(buf), "%s/%s/%s", gctx->path, 
subdirs[gmsg->status & M_RECENT], msg->base );
                s = strstr( msg->base, ":2," );
-               nfsnprintf( nbuf, sizeof(nbuf), "%s%s/%s/%ld.%d_%d.%s%s", 
gctx->conf->path, gctx->conf->trash,
-                           subdirs[gmsg->status & M_RECENT], time( 0 ), Pid, 
++MaildirCount, Hostname, s ? s : "" );
+               nfsnprintf( nbuf, sizeof(nbuf), "%s%s/%s/%lld.%d_%d.%s%s", 
gctx->conf->path, gctx->conf->trash,
+                           subdirs[gmsg->status & M_RECENT], (long long int) 
time( 0 ), Pid, ++MaildirCount, Hostname, s ? s : "" );
                if (!rename( buf, nbuf ))
                        break;
                if (!stat( buf, &st )) {

Attachment: pgpP3dcx1UlzX.pgp
Description: PGP signature

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to