[LTP] openposix: timers/twoevtimers: Wait for both timer signals
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Fri Oct 9 19:26:01 CEST 2026
Hi Jan,
On Fri, 9 Oct 2026, Jan Stancek via ltp wrote:
> openposix: timers/twoevtimers: Wait for both timer signals
> + PTS_WRITE_MSG("Caught abort signal\n");
> + PTS_WRITE_MSG("Caught alarm signal\n");
> + if (errno != EINTR) {
> + perror("nanosleep() did not return success\n");
> + return PTS_UNRESOLVED;
> + }
Medium: PTS_WRITE_MSG() calls write() without preserving errno. If the
second signal arrives after nanosleep() sets EINTR but before the new
errno check, a failed handler write (e.g. EAGAIN on a full nonblocking
stdout pipe) causes a spurious unresolved result even when both timers
fired. Save errno on entry and restore it before returning in both
handlers.
Verdict - Needs revision
---
Note:
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