修复tcc编译失败的bug

This commit is contained in:
zhangzheng
2023-12-08 23:55:00 +08:00
parent f3062af123
commit 9e7c1e08ee
12 changed files with 59 additions and 14 deletions

View File

@@ -52,6 +52,10 @@ static file_desc_t *file_get(int fd)
{
return NULL;
}
if (files[fd].fp.obj.fs == NULL)
{
return NULL;
}
return files + fd;
}
static int fatfs_err_conv(FRESULT res)
@@ -146,7 +150,11 @@ int fs_svr_open(const char *path, int flags, int mode)
// cons_write_str("open file..\n");
}
return fatfs_err_conv(ret);
if (ret != FR_OK)
{
return fatfs_err_conv(ret);
}
return fd;
}
int fs_svr_read(int fd, void *buf, size_t len)