[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-sync.c, 1.43,
1.44
cras at procontrol.fi
cras at procontrol.fi
Sun Jun 20 14:23:41 EEST 2004
Update of /home/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv10412/lib-storage/index/mbox
Modified Files:
mbox-sync.c
Log Message:
fsync() mbox before unlocking if we've modified it
Index: mbox-sync.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- mbox-sync.c 20 Jun 2004 11:17:53 -0000 1.43
+++ mbox-sync.c 20 Jun 2004 11:23:39 -0000 1.44
@@ -1159,6 +1159,13 @@
}
}
+ if (ret == 0 && ibox->mbox_lock_type == F_WRLCK) {
+ if (fsync(ibox->mbox_fd) < 0) {
+ mbox_set_syscall_error(ibox, "fsync()");
+ ret = -1;
+ }
+ }
+
if (sync_ctx.lock_id != 0 && ibox->mbox_lock_type != F_RDLCK) {
/* drop to read lock */
unsigned int lock_id = 0;
More information about the dovecot-cvs
mailing list