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);
|
_FAT_lock(&file->partition->lock);
|
||||||
|
|
||||||
ret = _FAT_syncToDisc (file);
|
if (file->write) {
|
||||||
if (ret != 0) {
|
ret = _FAT_syncToDisc (file);
|
||||||
r->_errno = ret;
|
if (ret != 0) {
|
||||||
ret = -1;
|
r->_errno = ret;
|
||||||
|
ret = -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
file->inUse = false;
|
file->inUse = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user