!364 fix:修复文件系统vfs层未正确判空g_fs的问题

Merge pull request !364 from Far/master
This commit is contained in:
openharmony_ci 2021-10-20 03:41:43 +00:00 committed by Gitee
commit f886283b3b
1 changed files with 4 additions and 4 deletions

View File

@ -347,14 +347,14 @@ ssize_t read(int fd, void *buf, size_t nbyte)
return recv(fd, buf, nbyte, 0);
}
#endif
if (g_fs->fsFops == NULL || g_fs->fsFops->Read == NULL) {
errno = ENOSYS;
return FS_FAILURE;
}
if (g_fs == NULL) {
errno = ENODEV;
return FS_FAILURE;
}
if (g_fs->fsFops == NULL || g_fs->fsFops->Read == NULL) {
errno = ENOSYS;
return FS_FAILURE;
}
return g_fs->fsFops->Read(fd, buf, nbyte);
}