sigwaitinfo() may fail with EINTR if interrupted by an unblocked signal not in the set
Fixes #1213.
This commit is contained in:
@@ -88,6 +88,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;
|
||||
}
|
||||
@@ -101,9 +105,6 @@ static int run()
|
||||
DBG1(DBG_DMN, "signal of type SIGTERM received. Shutting down");
|
||||
charon->bus->alert(charon->bus, ALERT_SHUTDOWN_SIGNAL, sig);
|
||||
return 0;
|
||||
default:
|
||||
DBG1(DBG_DMN, "unknown signal %d received. Ignored", sig);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user