Simplify handling of terminating signals in all libcharon wrappers

Closes strongswan/strongswan#182.
This commit is contained in:
Tobias Brunner
2020-09-30 12:47:39 +02:00
parent ddc5b92dfb
commit 040608a48d
5 changed files with 10 additions and 28 deletions
+2 -4
View File
@@ -92,11 +92,9 @@ static int run()
switch (sig)
{
case SIGINT:
DBG1(DBG_DMN, "signal of type SIGINT received. Shutting down");
charon->bus->alert(charon->bus, ALERT_SHUTDOWN_SIGNAL, sig);
return 0;
case SIGTERM:
DBG1(DBG_DMN, "signal of type SIGTERM received. Shutting down");
DBG1(DBG_DMN, "%s received, shutting down",
sig == SIGINT ? "SIGINT" : "SIGTERM");
charon->bus->alert(charon->bus, ALERT_SHUTDOWN_SIGNAL, sig);
return 0;
}