[dovecot-cvs] dovecot: Continuing the previous time difference commit..

dovecot at dovecot.org dovecot at dovecot.org
Fri May 25 18:19:00 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/b796701a6927
changeset: 5664:b796701a6927
user:      Timo Sirainen <tss at iki.fi>
date:      Fri May 25 18:17:54 2007 +0300
description:
Continuing the previous time difference commit..

diffstat:

1 file changed, 6 insertions(+), 1 deletion(-)
src/lib/file-dotlock.c |    7 ++++++-

diffs (24 lines):

diff -r 3c026711c35b -r b796701a6927 src/lib/file-dotlock.c
--- a/src/lib/file-dotlock.c	Fri May 25 18:16:27 2007 +0300
+++ b/src/lib/file-dotlock.c	Fri May 25 18:17:54 2007 +0300
@@ -24,6 +24,10 @@
 /* If the dotlock is newer than this, don't verify that the PID it contains
    is valid (since it most likely is). */
 #define STALE_PID_CHECK_SECS 2
+
+/* Maximum difference between current time and create file's ctime before
+   logging a warning. Should be less than a second in normal operation. */
+#define MAX_TIME_DIFF 30
 
 struct dotlock {
 	struct dotlock_settings settings;
@@ -452,7 +456,8 @@ static int dotlock_create(const char *pa
                         dotlock->lock_time = now;
 			lock_info.fd = -1;
 
-			if (st.st_ctime + 60 < now || st.st_ctime - 60 > now) {
+			if (st.st_ctime + MAX_TIME_DIFF < now ||
+			    st.st_ctime - MAX_TIME_DIFF > now) {
 				i_warning("Created dotlock file's timestamp is "
 					  "different than current time "
 					  "(%s vs %s): %s", dec2str(st.st_ctime),


More information about the dovecot-cvs mailing list