Mercurial > dovecot > original-hg > dovecot-1.2
changeset 5664:b796701a6927 HEAD
Continuing the previous time difference commit..
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 25 May 2007 18:17:54 +0300 |
parents | 3c026711c35b |
children | 1680709ec0a2 |
files | src/lib/file-dotlock.c |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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 @@ -25,6 +25,10 @@ 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 @@ 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),