From d4dc0f6ec7873487d7aa9a4241aa31c7a437747a Mon Sep 17 00:00:00 2001 From: guoshichao Date: Fri, 9 Jun 2023 19:36:43 +0800 Subject: [PATCH] libs/libc/aio: fix aio_fsync compatible issue 1. make the aio_fsync implementation can pass the ltp/open_posix_testsuite/aio_fsync testcases 2. the modification are referred to https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_fsync.html Signed-off-by: guoshichao --- fs/aio/aio_fsync.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/aio/aio_fsync.c b/fs/aio/aio_fsync.c index 932656bd25..9c2075a6c1 100644 --- a/fs/aio/aio_fsync.c +++ b/fs/aio/aio_fsync.c @@ -191,7 +191,12 @@ int aio_fsync(int op, FAR struct aiocb *aiocbp) FAR struct aio_container_s *aioc; int ret; - DEBUGASSERT(op == O_SYNC); /* || op == O_DSYNC */ + if (op != O_SYNC) + { + set_errno(EINVAL); + return ERROR; + } + DEBUGASSERT(aiocbp); /* The result -EINPROGRESS means that the transfer has not yet completed */