sigwaitinfo() may fail with EINTR if interrupted by an unblocked signal not in the set
[strongswan.git] / src / charon-tkm / src / charon-tkm.c
index 52d82f3..3923c8a 100644 (file)
@@ -104,6 +104,10 @@ static void 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;
                }
@@ -121,11 +125,6 @@ static void run()
                                charon->bus->alert(charon->bus, ALERT_SHUTDOWN_SIGNAL, sig);
                                return;
                        }
-                       default:
-                       {
-                               DBG1(DBG_DMN, "unknown signal %d received. Ignored", sig);
-                               break;
-                       }
                }
        }
 }