mirror of
https://github.com/wiiu-env/libfat.git
synced 2024-11-01 00:05:06 +01:00
only sync if file open for writing
This commit is contained in:
parent
980ade67d4
commit
76a9624d2e
@ -316,10 +316,12 @@ int _FAT_close_r (struct _reent *r, int fd) {
|
||||
|
||||
_FAT_lock(&file->partition->lock);
|
||||
|
||||
ret = _FAT_syncToDisc (file);
|
||||
if (ret != 0) {
|
||||
r->_errno = ret;
|
||||
ret = -1;
|
||||
if (file->write) {
|
||||
ret = _FAT_syncToDisc (file);
|
||||
if (ret != 0) {
|
||||
r->_errno = ret;
|
||||
ret = -1;
|
||||
}
|
||||
}
|
||||
|
||||
file->inUse = false;
|
||||
|
Loading…
Reference in New Issue
Block a user