$ /usr/sbin/dovecot --exec-mail ext expire-tool --test
Info: Trash: timestamp 1243963680 (Tue Jun  2 19:28:00 2009
) -> 1244307774 (Tue Jun  2 19:28:00 2009
)
Both human readable timestamps are equal as ctime() returns a pointer
to a static buffer. In addition there are some newline characters added
by ctime(). The following patch is a try to fix this for 1.2.rc5.
--- expire-tool.c.orig  2009-06-06 13:29:31.000000000 +0200
+++ expire-tool.c       2009-06-06 15:17:07.000000000 +0200
@@ -351,9 +351,13 @@ static void expire_run(bool testrun)
                        } else if (!testrun)
                                dict_set(trans, key, new_value);
                        else {
-                               i_info("%s: timestamp %s (%s) -> %s
(%s)",
-                                      userp, value, ctime(&expire_time),
-                                      new_value, ctime(&oldest));
+                               char *expire_ctime =
i_strdup(ctime(&expire_time));
+                               char *oldest_ctime =
i_strdup(ctime(&oldest));
+                               i_info("%s: timestamp %s (%.24s) -> %s
(%.24s)",
+                                      userp, value, expire_ctime,
+                                      new_value, oldest_ctime);
+                               i_free(expire_ctime);
+                               i_free(oldest_ctime);
                        }
                }
        }
On Sat, 2009-06-06 at 15:35 +0200, e-frog wrote:> $ /usr/sbin/dovecot --exec-mail ext expire-tool --test > Info: Trash: timestamp 1243963680 (Tue Jun 2 19:28:00 2009 > ) -> 1244307774 (Tue Jun 2 19:28:00 2009 > ) > > Both human readable timestamps are equal as ctime() returns a pointer > to a static buffer. In addition there are some newline characters added > by ctime(). The following patch is a try to fix this for 1.2.rc5.Thanks. I fixed it a bit differently: http://hg.dovecot.org/dovecot-1.2/rev/1d343780e009 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20090615/835c9ad5/attachment-0002.bin>
Timo Sirainen schrieb:> On Sat, 2009-06-06 at 15:35 +0200, e-frog wrote: >> $ /usr/sbin/dovecot --exec-mail ext expire-tool --test >> Info: Trash: timestamp 1243963680 (Tue Jun 2 19:28:00 2009 >> ) -> 1244307774 (Tue Jun 2 19:28:00 2009 >> ) >> >> Both human readable timestamps are equal as ctime() returns a pointer >> to a static buffer. In addition there are some newline characters added >> by ctime(). The following patch is a try to fix this for 1.2.rc5. > > Thanks. I fixed it a bit differently: > http://hg.dovecot.org/dovecot-1.2/rev/1d343780e009 >Thanks Timo! The timestamps are ok now, however there are still the newlines. Just cosmetic though :-) Info: Trash: timestamp 1240263356 (Mon Apr 20 23:35:56 2009 ) -> 1245263356 (Wed Jun 17 20:29:16 2009 )