sigwaitinfo() may fail with EINTR if interrupted by an unblocked signal not in the set

Fixes #1213.
This commit is contained in:
Tobias Brunner
2015-11-23 11:37:19 +01:00
parent b675909662
commit 88b85e022a
9 changed files with 35 additions and 32 deletions
+5 -1
View File
@@ -21,6 +21,7 @@
#include <fcgiapp.h>
#include <signal.h>
#include <unistd.h>
#include <errno.h>
#include <utils/debug.h>
#include <threading/thread.h>
@@ -389,7 +390,10 @@ METHOD(fast_dispatcher_t, waitsignal, void,
sigaddset(&set, SIGTERM);
sigaddset(&set, SIGHUP);
sigprocmask(SIG_BLOCK, &set, NULL);
sigwaitinfo(&set, NULL);
while (sigwaitinfo(&set, NULL) == -1 && errno == EINTR)
{
/* wait for signal */
}
}
METHOD(fast_dispatcher_t, destroy, void,