This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/3] Use reliable sem_wait interruption in nptl/tst-sem6.
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Torvald Riegel <triegel at redhat dot com>
- Cc: GLIBC Devel <libc-alpha at sourceware dot org>
- Date: Sat, 6 Dec 2014 14:50:40 +0100
- Subject: Re: [PATCH 1/3] Use reliable sem_wait interruption in nptl/tst-sem6.
- Authentication-results: sourceware.org; auth=none
- References: <1417804668 dot 22797 dot 108 dot camel at triegel dot csb> <1417805577 dot 25868 dot 4 dot camel at triegel dot csb>
On Fri, Dec 05, 2014 at 07:52:57PM +0100, Torvald Riegel wrote:
> alarm (1);
>
> int res = sem_wait (&s);
> - if (res == 0)
> - {
> - puts ("wait succeeded");
> - return 1;
> - }
> - if (res != -1 || errno != EINTR)
> + /* We accept all allowed behavior: Implementations that return EINTR and
> + those that rely on correct interruption through signals to use sem_post
> + in the signal handler. */
> + if (res != 0 && !(res == -1 && errno == EINTR))
> {
> - puts ("wait didn't fail with EINTR");
> + puts ("wait neiter succeeded nor failed with EINTR");
> return 1;
> }
>
That does change test logic as it originally failed when wait succeeded.