[LTP] aio_cancel: Fix incorrect strerror() usage

linuxtestproject.agent@gmail.com linuxtestproject.agent@gmail.com
Tue Apr 28 16:44:17 CEST 2026


Hi Martin,

--- [PATCH 1/2] ---

On 2026-04-28, Martin Doucha wrote:
> aio_cancel: Fix incorrect strerror() usage

This is fixing a real bug but both patches in this series are missing
Fixes: tags.

--- [PATCH 2/2] ---

On 2026-04-28, Martin Doucha wrote:
> aio_cancel_6-1: Rewrite test

> +	if (gret != AIO_CANCELED) {
> +		printf(TNAME " Unexpected aio_cancel() return value: %s\n",
> +			strerror(gret));

strerror() expects an errno value; AIO_CANCELED, AIO_NOTCANCELED, and
AIO_ALLDONE are not errno values (they are 0, 1, 2 on Linux, mapping to
"Success", "Operation not permitted", "No such file or directory").
Use "%d" to print the raw integer instead.

Pre-existing issues noticed in the surrounding code (not introduced
by this patch):

- 5-1.c:70, 7-1.c:56 — nanosleep() used for synchronization in a
  polling loop (sleep-based sync).

---
Note:

Our agent completed the review of the patch. The agent can sometimes
produce false positives although often its findings are genuine. If you
find issues with the review, please comment this email or ignore the
suggestions.

Regards,
LTP AI Reviewer


More information about the ltp mailing list