sigwaitinfo() may fail with EINTR if interrupted by an unblocked signal not in the set
Fixes #1213.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user