X-Git-Url: https://vaikene.ee/gitweb/pswgen11.html?a=blobdiff_plain;f=src%2Fmain%2FCLI%2Fexithandler.cpp;h=0961ce5a547db21c36aaf910a8663caba321dac2;hb=HEAD;hp=a96842d084ce71a2485380e450ff671670ccf7f6;hpb=dda7da0549233d54ada594ebf0771ad9a6841050;p=evaf
diff --git a/src/main/CLI/exithandler.cpp b/src/main/CLI/exithandler.cpp
index a96842d..0961ce5 100644
--- a/src/main/CLI/exithandler.cpp
+++ b/src/main/CLI/exithandler.cpp
@@ -3,7 +3,7 @@
* @brief Exit handlers for the eVaf main executable
* @author Enar Vaikene
*
- * Copyright (c) 2011 Enar Vaikene
+ * Copyright (c) 2011-2019 Enar Vaikene
*
* This file is part of the eVaf C++ cross-platform application development framework.
*
@@ -24,7 +24,7 @@
#include
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_LINUX) || defined(Q_OS_MACOS)
# include
#endif
@@ -36,7 +36,7 @@ namespace eVaf {
namespace CLI {
namespace Internal {
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_LINUX) || defined(Q_OS_MACOS)
/**
* Signal handler on Linux
@@ -111,15 +111,15 @@ static BOOL WINAPI signalHandler(DWORD sig)
bool eVaf::CLI::Internal::installExitHandler()
{
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_LINUX) || defined(Q_OS_MACOS)
struct sigaction sa;
memset(&sa, 0, sizeof(sa));
sa.sa_handler = signalHandler;
- if (sigaction(SIGTERM, &sa, NULL) != 0) {
+ if (sigaction(SIGTERM, &sa, nullptr) != 0) {
EVAF_FATAL_ERROR("sigaction() failed: %m");
return false;
}
- if (sigaction(SIGHUP, &sa, NULL) != 0) {
+ if (sigaction(SIGHUP, &sa, nullptr) != 0) {
EVAF_FATAL_ERROR("sigaction() failed: %m");
return false;
}