Skip to content
Snippets Groups Projects
Commit b5e4738a authored by deuce's avatar deuce
Browse files

If sigwait() fails due to EINTR, block and log the signal which caused the

failure.
parent bb202aa5
Branches
Tags
No related merge requests found
......@@ -934,6 +934,13 @@ static void handle_sigs(void)
while(1) {
if((i=sigwait(&sigs,&sig))!=0) { /* wait here until signaled */
lprintf(LOG_ERR," !sigwait FAILURE (%d)", i);
if(i==EINTR) {
sigset_t moresigs;
lprintf(LOG_ERR," Adding signal %d to blocked set",i);
memcpy(&moresigs, &sigs, sizeof(moresigs));
sigaddset(&sigs, sig);
pthread_sigmask(SIG_BLOCK,&moresigs,NULL);
}
continue;
}
lprintf(LOG_NOTICE," Got signal (%d)", sig);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment