This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new d4dc0f6ec7 libs/libc/aio: fix aio_fsync compatible issue
d4dc0f6ec7 is described below

commit d4dc0f6ec7873487d7aa9a4241aa31c7a437747a
Author: guoshichao <[email protected]>
AuthorDate: Fri Jun 9 19:36:43 2023 +0800

    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 <[email protected]>
---
 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 */

Reply via email to