Merge pull request #5183 from geky/fix-dir-open-failures

fs: Fix dir open during failure condition
pull/5217/head
Jimmy Brisson 2017-09-28 13:59:28 -05:00 committed by GitHub
commit 5a018585c6
1 changed files with 6 additions and 2 deletions

View File

@ -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()