From 4de982bc8fa356f77e8dc8c0c43356efbc48e749 Mon Sep 17 00:00:00 2001 From: Erik Sohns Date: Sat, 15 Nov 2025 18:57:34 +0100 Subject: [PATCH] excerpt from the aio_cancel manpage: ..."If aiocbp is not NULL, and fd differs from the file descriptor with which the asynchronous operation was initiated, unspecified results occur. ..." I debugged this on Linux, and the call returns -1, setting errno to EINVAL. This PR fixes that condition. --- ACE/ace/POSIX_Proactor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ACE/ace/POSIX_Proactor.cpp b/ACE/ace/POSIX_Proactor.cpp index e720c06dbe75f..c75cbc6afb98f 100644 --- a/ACE/ace/POSIX_Proactor.cpp +++ b/ACE/ace/POSIX_Proactor.cpp @@ -1502,9 +1502,11 @@ ACE_POSIX_AIOCB_Proactor::cancel_aio (ACE_HANDLE handle) int ACE_POSIX_AIOCB_Proactor::cancel_aiocb (ACE_POSIX_Asynch_Result * result) { + ACE_ASSERT (result); + // This method is called from cancel_aio // to cancel a previously submitted AIO request - int rc = ::aio_cancel (0, result); + int rc = ::aio_cancel (result->aio_fildes, result); // Check the return value and return 0/1/2 appropriately. if (rc == AIO_CANCELED)