commit 38828610d918e857a452da1f9e7f2e4407960419
Author: Oswald Buddenhagen <o...@kde.org>
Date:   Sat Jul 23 12:49:08 2011 +0200

    check return value from close() after write()
    
    otherwise we may lose data when quota is exceeded
    or nfs is in a bad mood.

 src/drv_maildir.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/drv_maildir.c b/src/drv_maildir.c
index 05a1ee4..09d5e5f 100644
--- a/src/drv_maildir.c
+++ b/src/drv_maildir.c
@@ -1028,7 +1028,11 @@ maildir_store_msg( store_t *gctx, msg_data_t *data, int 
to_trash,
                close( fd );
                return cb( DRV_BOX_BAD, 0, aux );
        }
-       close( fd );
+       if (close( fd ) < 0) {
+               /* Quota exceeded may cause this. */
+               perror( buf );
+               return cb( DRV_BOX_BAD, 0, aux );
+       }
        /* Moving seen messages to cur/ is strictly speaking incorrect, but 
makes mutt happy. */
        nfsnprintf( nbuf, sizeof(nbuf), "%s%s/%s/%s%s", prefix, box, 
subdirs[!(data->flags & F_SEEN)], base, fbuf );
        if (rename( buf, nbuf )) {

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to