commit 2e6da7f223945003e2afc0c599e90081eb1ce4e5 Author: Oswald Buddenhagen <o...@kde.org> Date: Sat Sep 15 14:15:07 2012 +0200
avoid that a system crash can lose mails this fixes two possible failure scenarios: - if the journal is committed but the mails are not, the missing files would be erroneously interpreted as deletions which would be propagated - less seriously, if the mail files' meta data was committed but the file contents were not, we would end up with empty files, which would have to be re-fetched "behind mbsync's back" (just deleting the files would not work - see above) src/drv_maildir.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/drv_maildir.c b/src/drv_maildir.c index 164f7b5..921f97f 100644 --- a/src/drv_maildir.c +++ b/src/drv_maildir.c @@ -1204,7 +1204,7 @@ maildir_store_msg( store_t *gctx, msg_data_t *data, int to_trash, } ret = write( fd, data->data, data->len ); free( data->data ); - if (ret != data->len) { + if (ret != data->len || (ret = fsync( fd ))) { if (ret < 0) sys_error( "Maildir error: cannot write %s", buf ); else ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://ad.doubleclick.net/clk;258768047;13503038;j? http://info.appdynamics.com/FreeJavaPerformanceDownload.html _______________________________________________ isync-devel mailing list isync-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/isync-devel