* [LTP] [PATCH 1/2] aio_cancel: Fix incorrect strerror() usage
@ 2026-04-28 13:32 Martin Doucha
2026-04-28 14:44 ` [LTP] " linuxtestproject.agent
2026-04-29 7:13 ` [LTP] [PATCH 1/2] " Andrea Cervesato via ltp
0 siblings, 2 replies; 3+ messages in thread
From: Martin Doucha @ 2026-04-28 13:32 UTC (permalink / raw)
To: ltp
Each call of strerror() invalidates the previous return value. Split
print calls to avoid calling strerror() twice in the argument list.
Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
.../conformance/interfaces/aio_cancel/5-1.c | 5 +++--
.../conformance/interfaces/aio_cancel/7-1.c | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c
index dd5b0bbfb..04306417e 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c
@@ -131,8 +131,9 @@ int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
}
if (ret != exp_ret) {
- printf(TNAME " Bad task #%d result: %s (expected %s)\n",
- i, strerror(ret), strerror(exp_ret));
+ printf(TNAME " Bad task #%d result: %s",
+ i, strerror(ret));
+ printf(" (expected %s)\n", strerror(exp_ret));
cleanup_aio(fds, aiocb, BUF_NB);
return PTS_FAIL;
}
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c
index 36ce8bb12..0fdc1bef8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c
@@ -118,8 +118,9 @@ int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
}
if (ret != exp_ret) {
- printf(TNAME " Bad task #%d result: %s (expected %s)\n",
- i, strerror(ret), strerror(exp_ret));
+ printf(TNAME " Bad task #%d result: %s",
+ i, strerror(ret));
+ printf(" (expected %s)\n", strerror(exp_ret));
cleanup_aio(fds, aiocb, BUF_NB);
return PTS_FAIL;
}
--
2.53.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [LTP] aio_cancel: Fix incorrect strerror() usage
2026-04-28 13:32 [LTP] [PATCH 1/2] aio_cancel: Fix incorrect strerror() usage Martin Doucha
@ 2026-04-28 14:44 ` linuxtestproject.agent
2026-04-29 7:13 ` [LTP] [PATCH 1/2] " Andrea Cervesato via ltp
1 sibling, 0 replies; 3+ messages in thread
From: linuxtestproject.agent @ 2026-04-28 14:44 UTC (permalink / raw)
To: Martin Doucha; +Cc: ltp
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
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH 1/2] aio_cancel: Fix incorrect strerror() usage
2026-04-28 13:32 [LTP] [PATCH 1/2] aio_cancel: Fix incorrect strerror() usage Martin Doucha
2026-04-28 14:44 ` [LTP] " linuxtestproject.agent
@ 2026-04-29 7:13 ` Andrea Cervesato via ltp
1 sibling, 0 replies; 3+ messages in thread
From: Andrea Cervesato via ltp @ 2026-04-29 7:13 UTC (permalink / raw)
To: Martin Doucha; +Cc: ltp
Hi Martin,
please update the patch as requested in the agent review, I will move
this to Change Requested waiting for v2.
Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-29 7:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-28 13:32 [LTP] [PATCH 1/2] aio_cancel: Fix incorrect strerror() usage Martin Doucha
2026-04-28 14:44 ` [LTP] " linuxtestproject.agent
2026-04-29 7:13 ` [LTP] [PATCH 1/2] " Andrea Cervesato via ltp
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox