* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "signalhandler.hpp"
-#include <assert.h>
-#include <signal.h>
-#include <stdlib.h>
+#include <cassert>
+#include <csignal>
+#include <cstdlib>
+
#include <sys/socket.h>
#include <unistd.h>
sig_action.sa_flags = SA_RESTART;
if (sigaction(SIGINT, &sig_action, nullptr) != 0 ||
- sigaction(SIGTERM, &sig_action, nullptr) != 0) {
+ sigaction(SIGTERM, &sig_action, nullptr) != 0 ||
+ sigaction(SIGUSR1, &sig_action, nullptr) != 0) {
close(sockets_[0]);
close(sockets_[1]);
return false;
abort();
}
- switch(sig_number)
- {
+ switch (sig_number) {
case SIGINT:
Q_EMIT int_received();
break;
case SIGTERM:
Q_EMIT term_received();
break;
+ case SIGUSR1:
+ Q_EMIT usr1_received();
+ break;
}
socket_notifier_->setEnabled(true);