[dovecot-cvs] dovecot/src/lib file-dotlock.c,1.12,1.13
cras at procontrol.fi
cras at procontrol.fi
Mon May 17 02:16:25 EEST 2004
Update of /home/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv2046
Modified Files:
file-dotlock.c
Log Message:
file_dotlock_delete(): don't complain about mtime changes in lock file, as
we most likely did it ourself
Index: file-dotlock.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/file-dotlock.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- file-dotlock.c 3 May 2004 22:08:26 -0000 1.12
+++ file-dotlock.c 16 May 2004 23:16:23 -0000 1.13
@@ -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);
}
More information about the dovecot-cvs
mailing list