Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions libraries/FS/src/vfs_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,12 @@ VFSFileImpl::VFSFileImpl(VFSImpl *fs, const char *fpath, const char *mode) : _fs
if (!_f) {
log_e("fopen(%s) failed", temp);
}
if (_f && (_stat.st_blksize == 0)) {
setvbuf(_f, NULL, _IOFBF, DEFAULT_FILE_BUFFER_SIZE);
if (!stat(temp, &_stat)) {
if (_f && (_stat.st_blksize == 0)) {
setvbuf(_f, NULL, _IOFBF, DEFAULT_FILE_BUFFER_SIZE);
}
} else {
log_w("stat(%s) failed", temp);
}
}
free(temp);
Expand Down
Loading