changeset 2025:ced02e8023c6 HEAD

file_dotlock_delete(): don't complain about mtime changes in lock file, as we most likely did it ourself
author Timo Sirainen <tss@iki.fi>
date Mon, 17 May 2004 02:16:23 +0300
parents 8bb1db13c94a
children 53585aa87f9c
files src/lib/file-dotlock.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib/file-dotlock.c	Mon May 17 02:12:49 2004 +0300
+++ b/src/lib/file-dotlock.c	Mon May 17 02:16:23 2004 +0300
@@ -383,7 +383,7 @@
 }
 
 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 @@
 		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 @@
 
 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 @@
 	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);
 }