diff options
| author | Bernard Xiong <[email protected]> | 2019-01-21 19:41:38 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-01-21 19:41:38 +0800 |
| commit | bef1d55736d589c45fece3f0660473cc34d15029 (patch) | |
| tree | 7d4417e7fa5607b342d21b7cd5c69f0c096af4d8 | |
| parent | 929e9c8f4bba8125064ac60f8985c6faacec009b (diff) | |
| parent | 97560dd8e208d7b7fc2262cef135a3cbcaeae2eb (diff) | |
Merge pull request #2244 from RT-Thread/fix_libc_posix
Fix libc posix
| -rw-r--r-- | components/libc/aio/posix_aio.c | 3 | ||||
| -rw-r--r-- | components/libc/mmap/posix_mmap.c | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/components/libc/aio/posix_aio.c b/components/libc/aio/posix_aio.c index 75e7de9ce3..3eb7634495 100644 --- a/components/libc/aio/posix_aio.c +++ b/components/libc/aio/posix_aio.c @@ -170,7 +170,7 @@ static void aio_read_work(struct rt_work* work, void* work_data) if (len <= 0) cb->aio_result = errno; else - cb->aio_result = 0; + cb->aio_result = len; rt_hw_interrupt_enable(level); return ; @@ -321,6 +321,7 @@ static void aio_write_work(struct rt_work* work, void* work_data) return; } + /** * The aio_write() function shall write aiocbp->aio_nbytes to the file associated * with aiocbp->aio_fildes from the buffer pointed to by aiocbp->aio_buf. The diff --git a/components/libc/mmap/posix_mmap.c b/components/libc/mmap/posix_mmap.c index 3d405aad77..a16ace8306 100644 --- a/components/libc/mmap/posix_mmap.c +++ b/components/libc/mmap/posix_mmap.c @@ -35,7 +35,7 @@ void *mmap(void *addr, size_t length, int prot, int flags, cur = lseek(fd, 0, SEEK_SET); lseek(fd, offset, SEEK_SET); - read_bytes = read(fd, addr, length); + read_bytes = read(fd, mem, length); if (read_bytes != length) { if (addr == RT_NULL) |
