It seems that sigwait() returns EINTR, which is not even a specified error for sigwait().
It is not specified for sigwait http://pubs.opengroup.org/onlinepubs/9699919799/functions/sigwait.html but is is specified for sigwaitinfo http://pubs.opengroup.org/onlinepubs/9699919799/functions/sigwaitinfo.html It is counterintuitive, I am testing a fix now. Petr