check return value from close() after write()
otherwise we may lose data when quota is exceeded or nfs is in a bad mood.
This commit is contained in:
parent
61d98c5a1d
commit
f6a25b331f
|
@ -1028,7 +1028,11 @@ maildir_store_msg( store_t *gctx, msg_data_t *data, int to_trash,
|
||||||
close( fd );
|
close( fd );
|
||||||
return cb( DRV_BOX_BAD, 0, aux );
|
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. */
|
/* 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 );
|
nfsnprintf( nbuf, sizeof(nbuf), "%s%s/%s/%s%s", prefix, box, subdirs[!(data->flags & F_SEEN)], base, fbuf );
|
||||||
if (rename( buf, nbuf )) {
|
if (rename( buf, nbuf )) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user