修复tcc编译失败的bug
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user