mirror of https://github.com/ARMmbed/mbed-os.git
fs: Fix dir open during failure condition
Should leave the Dir in an openable state, currently does not since it thinks it's in use by the fs it failed to open on.pull/5183/head
parent
c6f655c02e
commit
a6b3b55eb9
|
@ -43,8 +43,12 @@ int Dir::open(FileSystem *fs, const char *path)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
_fs = fs;
|
||||
return _fs->dir_open(&_dir, path);
|
||||
int err = fs->dir_open(&_dir, path);
|
||||
if (!err) {
|
||||
_fs = fs;
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
int Dir::close()
|
||||
|
|
Loading…
Reference in New Issue