Skip to content

Commit bef1d55

Browse files
authored
Merge pull request #2244 from RT-Thread/fix_libc_posix
Fix libc posix
2 parents 929e9c8 + 97560dd commit bef1d55

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

components/libc/aio/posix_aio.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ static void aio_read_work(struct rt_work* work, void* work_data)
170170
if (len <= 0)
171171
cb->aio_result = errno;
172172
else
173-
cb->aio_result = 0;
173+
cb->aio_result = len;
174174
rt_hw_interrupt_enable(level);
175175

176176
return ;
@@ -321,6 +321,7 @@ static void aio_write_work(struct rt_work* work, void* work_data)
321321

322322
return;
323323
}
324+
324325
/**
325326
* The aio_write() function shall write aiocbp->aio_nbytes to the file associated
326327
* with aiocbp->aio_fildes from the buffer pointed to by aiocbp->aio_buf. The

components/libc/mmap/posix_mmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void *mmap(void *addr, size_t length, int prot, int flags,
3535
cur = lseek(fd, 0, SEEK_SET);
3636

3737
lseek(fd, offset, SEEK_SET);
38-
read_bytes = read(fd, addr, length);
38+
read_bytes = read(fd, mem, length);
3939
if (read_bytes != length)
4040
{
4141
if (addr == RT_NULL)

0 commit comments

Comments
 (0)