AP_Filesystem: fixed open for write in ROMFS

This commit is contained in:
Andrew Tridgell 2020-03-12 16:35:22 +11:00
parent e0957c2bcc
commit a8f7212d79
1 changed files with 4 additions and 0 deletions

View File

@ -25,6 +25,10 @@
int AP_Filesystem_ROMFS::open(const char *fname, int flags)
{
if ((flags & O_ACCMODE) != O_RDONLY) {
errno = EROFS;
return -1;
}
uint8_t idx;
for (idx=0; idx<max_open_file; idx++) {
if (file[idx].data == nullptr) {