Mercurial > dovecot > original-hg > dovecot-1.2
changeset 5663:3c026711c35b HEAD
Log a warning if filesystem's clock is +-30 different from the system clock
(fix the previous wrong check).
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 25 May 2007 18:16:27 +0300 |
parents | fdc30be3b5e5 |
children | b796701a6927 |
files | src/lib/file-dotlock.c |
diffstat | 1 files changed, 3 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib/file-dotlock.c Fri May 25 18:10:47 2007 +0300 +++ b/src/lib/file-dotlock.c Fri May 25 18:16:27 2007 +0300 @@ -452,12 +452,10 @@ dotlock->lock_time = now; lock_info.fd = -1; - if (st.st_ctime < now) - now = time(NULL); - if (st.st_ctime < now) { + if (st.st_ctime + 60 < now || st.st_ctime - 60 > now) { i_warning("Created dotlock file's timestamp is " - "smaller than current time " - "(%s < %s): %s", dec2str(st.st_ctime), + "different than current time " + "(%s vs %s): %s", dec2str(st.st_ctime), dec2str(now), path); } }