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
+4 -5
View File
@@ -115,6 +115,10 @@ static int run()
sig = sigwaitinfo(&set, NULL);
if (sig == -1)
{
if (errno == EINTR)
{ /* ignore signals we didn't wait for */
continue;
}
DBG1(DBG_DMN, "waiting for signal failed: %s", strerror(errno));
return 1;
}
@@ -152,11 +156,6 @@ static int run()
charon->bus->alert(charon->bus, ALERT_SHUTDOWN_SIGNAL, sig);
return 1;
}
default:
{
DBG1(DBG_DMN, "unknown signal %d received. Ignored", sig);
break;
}
}
}
}