From: Timo Sirainen Date: Sun, 16 May 2004 23:16:23 +0000 (+0300) Subject: file_dotlock_delete(): don't complain about mtime changes in lock file, as X-Git-Tag: 1.1.alpha1~4081 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac67a027f8db99d0b65c656fe1e4f26261ae750f;p=thirdparty%2Fdovecot%2Fcore.git file_dotlock_delete(): don't complain about mtime changes in lock file, as we most likely did it ourself --HG-- branch : HEAD --- diff --git a/src/lib/file-dotlock.c b/src/lib/file-dotlock.c index 85cd177958..d2e6aac309 100644 --- a/src/lib/file-dotlock.c +++ b/src/lib/file-dotlock.c @@ -383,7 +383,7 @@ int file_lock_dotlock(const char *path, const char *temp_prefix, int checkonly, } static int dotlock_delete(const char *path, const char *lock_suffix, - const struct dotlock *dotlock) + const struct dotlock *dotlock, int check_mtime) { const char *lock_path; struct stat st; @@ -407,7 +407,7 @@ static int dotlock_delete(const char *path, const char *lock_suffix, return 0; } - if (dotlock->mtime != st.st_mtime) { + if (dotlock->mtime != st.st_mtime && check_mtime) { i_warning("Our dotlock file %s was modified (%s vs %s), " "assuming it wasn't overridden", lock_path, dec2str(dotlock->mtime), dec2str(st.st_mtime)); @@ -428,7 +428,7 @@ static int dotlock_delete(const char *path, const char *lock_suffix, int file_unlock_dotlock(const char *path, const struct dotlock *dotlock) { - return dotlock_delete(path, DEFAULT_LOCK_SUFFIX, dotlock); + return dotlock_delete(path, DEFAULT_LOCK_SUFFIX, dotlock, TRUE); } int file_dotlock_open(const char *path, @@ -527,5 +527,5 @@ int file_dotlock_delete(const char *path, const char *lock_suffix, int fd) dotlock.ino = st.st_ino; dotlock.mtime = st.st_mtime; - return dotlock_delete(path, lock_suffix, &dotlock); + return dotlock_delete(path, lock_suffix, &dotlock, FALSE); }