aboutsummaryrefslogtreecommitdiffstats
path: root/src/charon-systemd/charon-systemd.c
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2015-11-19 11:21:48 +0100
committerTobias Brunner <tobias@strongswan.org>2015-11-23 11:37:19 +0100
commit88b85e022a4dde71fa1829ffbf948be2d5d1987f (patch)
treebe5bff68c667c1d0d686808bfcc2962c774c5af3 /src/charon-systemd/charon-systemd.c
parentb675909662c20bd5c3eb28707e44f42d4ba60b89 (diff)
downloadstrongswan-88b85e022a4dde71fa1829ffbf948be2d5d1987f.tar.bz2
strongswan-88b85e022a4dde71fa1829ffbf948be2d5d1987f.tar.xz
sigwaitinfo() may fail with EINTR if interrupted by an unblocked signal not in the set
Fixes #1213.
Diffstat (limited to 'src/charon-systemd/charon-systemd.c')
-rw-r--r--src/charon-systemd/charon-systemd.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/charon-systemd/charon-systemd.c b/src/charon-systemd/charon-systemd.c
index f302d4527..4286cde82 100644
--- a/src/charon-systemd/charon-systemd.c
+++ b/src/charon-systemd/charon-systemd.c
@@ -254,6 +254,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 SS_RC_INITIALIZATION_FAILED;
}
@@ -265,11 +269,6 @@ static int run()
charon->bus->alert(charon->bus, ALERT_SHUTDOWN_SIGNAL, sig);
return 0;
}
- default:
- {
- DBG1(DBG_DMN, "unknown signal %d received. Ignored", sig);
- break;
- }
}
}
}