You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "pkarashchenko (via GitHub)" <gi...@apache.org> on 2023/06/28 01:47:16 UTC
[GitHub] [nuttx] pkarashchenko commented on a diff in pull request #9634: libs/libc/aio: fix aio_return compatible bug
pkarashchenko commented on code in PR #9634:
URL: https://github.com/apache/nuttx/pull/9634#discussion_r1244564086
##########
libs/libc/aio/aio_return.c:
##########
@@ -91,14 +91,24 @@
ssize_t aio_return(FAR struct aiocb *aiocbp)
{
+ ssize_t ret;
+
DEBUGASSERT(aiocbp);
if (aiocbp->aio_result < 0)
{
set_errno((int)-aiocbp->aio_result);
return (ssize_t)ERROR;
}
- return aiocbp->aio_result;
+ ret = aiocbp->aio_result;
+
+ /* the aio_return function may be called exactly only once, thereafter, if
+ * the same aiocbp structure is used in a call to aio_return, then error
+ * may be returned
+ */
+
+ aiocbp->aio_result = ERROR;
Review Comment:
```suggestion
aiocbp->aio_result = EINVAL;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org