fix file mmap (#8865)
This commit is contained in:
parent
fa1c473a96
commit
c359e93a9c
|
@ -184,7 +184,7 @@ void page_read(struct rt_varea *varea, struct rt_aspace_io_msg *msg)
|
|||
varea->start, varea->size, varea->offset, varea->attr, varea->flag);
|
||||
|
||||
ret = dfs_aspace_mmap_read(file, varea, msg);
|
||||
if (ret > 0)
|
||||
if (ret >= 0)
|
||||
{
|
||||
msg->response.status = MM_FAULT_STATUS_OK;
|
||||
if (ret < ARCH_PAGE_SIZE)
|
||||
|
|
|
@ -1105,7 +1105,7 @@ int dfs_aspace_read(struct dfs_file *file, void *buf, size_t count, off_t *pos)
|
|||
}
|
||||
|
||||
len = count > len ? len : count;
|
||||
if (len)
|
||||
if (len > 0)
|
||||
{
|
||||
rt_memcpy(ptr, page->page + *pos - page->fpos, len);
|
||||
ptr += len;
|
||||
|
|
Loading…
Reference in New Issue