Weird signal handling bug 221635

Colin Watson cjwatson at ubuntu.com
Fri May 2 17:01:40 BST 2008


On Fri, May 02, 2008 at 04:39:56PM +0100, Scott James Remnant wrote:
> On Thu, 2008-05-01 at 20:24 +0100, Colin Watson wrote:
> > True, but that's done with:
> > 
> > #ifdef SA_RESTART
> >         /* We rely on getting EINTR from select. */
> >         sigaction (SIGCHLD, NULL, &sa);
> >         sa.sa_flags &= ~SA_RESTART;
> >         sigaction (SIGCHLD, &sa, NULL);
> > #endif
> > 
> > [...]
> > 
> > #ifdef SA_RESTART
> >         sigaction (SIGCHLD, NULL, &sa);
> >         sa.sa_flags |= SA_RESTART;
> >         sigaction (SIGCHLD, &sa, NULL);
> > #endif
> 
> This will give you a race condition, but won't cause the bug you're
> seeing that I know of.

What's the race condition? I think I'm missing it.

Thanks,

-- 
Colin Watson                                       [cjwatson at ubuntu.com]



More information about the ubuntu-devel mailing list