mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-18 11:53:53 +08:00
[libc] Fix the addr=NULL issue in mmap.
This commit is contained in:
parent
75061a2712
commit
97560dd8e2
@ -35,7 +35,7 @@ void *mmap(void *addr, size_t length, int prot, int flags,
|
|||||||
cur = lseek(fd, 0, SEEK_SET);
|
cur = lseek(fd, 0, SEEK_SET);
|
||||||
|
|
||||||
lseek(fd, offset, SEEK_SET);
|
lseek(fd, offset, SEEK_SET);
|
||||||
read_bytes = read(fd, addr, length);
|
read_bytes = read(fd, mem, length);
|
||||||
if (read_bytes != length)
|
if (read_bytes != length)
|
||||||
{
|
{
|
||||||
if (addr == RT_NULL)
|
if (addr == RT_NULL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user