Permalink
Browse files

Fix OS X compilation

Signal SIGRTMIN doesn't exist under OS X so make all this code conditional.
  • Loading branch information...
jyavenard committed Oct 19, 2012
1 parent 150e572 commit 9f65a657827790687b8ac24daf7a4c581e7535a3
@@ -83,7 +83,10 @@ SignalHandler::SignalHandler(QList<int> &signallist, QObject *parent) :
s_defaultHandlerList << SIGINT << SIGTERM << SIGSEGV << SIGABRT
<< SIGFPE << SIGILL;
#ifndef _WIN32
s_defaultHandlerList << SIGBUS << SIGRTMIN;
s_defaultHandlerList << SIGBUS;
#if ! CONFIG_DARWIN
s_defaultHandlerList << SIGRTMIN;
#endif
if (::socketpair(AF_UNIX, SOCK_STREAM, 0, sigFd))
{
@@ -305,13 +308,16 @@ void SignalHandler::handleSignal(void)
SigHandlerFunc handler = NULL;
bool allowNullHandler = false;
#if ! CONFIG_DARWIN
if (signum == SIGRTMIN)
{
// glibc idiots seem to have made SIGRTMIN a macro that expands to a
// function, so we can't do this in the switch below.
// This uses the default handler to just get us here and to ignore it.
allowNullHandler = true;
}
#endif
switch (signum)
{
@@ -232,7 +232,10 @@ int main(int argc, char *argv[])
#ifndef _WIN32
QList<int> signallist;
signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
<< SIGILL << SIGRTMIN;
<< SIGILL;
#if ! CONFIG_DARWIN
signallist << SIGRTMIN;
#endif
SignalHandler::Init(signallist);
signal(SIGHUP, SIG_IGN);
#endif
@@ -103,7 +103,10 @@ int main(int argc, char **argv)
#ifndef _WIN32
QList<int> signallist;
signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
<< SIGILL << SIGRTMIN;
<< SIGILL;
#if ! CONFIG_DARWIN
signallist << SIGRTMIN;
#endif
SignalHandler::Init(signallist);
signal(SIGHUP, SIG_IGN);
#endif
@@ -145,7 +145,10 @@ int main(int argc, char *argv[])
#ifndef _WIN32
QList<int> signallist;
signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
<< SIGILL << SIGRTMIN;
<< SIGILL;
#if ! CONFIG_DARWIN
signallist << SIGRTMIN;
#endif
SignalHandler::Init(signallist);
signal(SIGHUP, SIG_IGN);
#endif
@@ -1126,7 +1126,10 @@ int main(int argc, char *argv[])
#ifndef _WIN32
QList<int> signallist;
signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
<< SIGILL << SIGRTMIN;
<< SIGILL;
#if ! CONFIG_DARWIN
signallist << SIGRTMIN;
#endif
SignalHandler::Init(signallist);
signal(SIGHUP, SIG_IGN);
#endif
@@ -348,7 +348,10 @@ int main(int argc, char *argv[])
#ifndef _WIN32
QList<int> signallist;
signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
<< SIGILL << SIGRTMIN;
<< SIGILL;
#if ! CONFIG_DARWIN
signallist << SIGRTMIN;
#endif
SignalHandler::Init(signallist);
signal(SIGHUP, SIG_IGN);
#endif
@@ -1478,7 +1478,10 @@ int main(int argc, char **argv)
#ifndef _WIN32
QList<int> signallist;
signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
<< SIGILL << SIGRTMIN;
<< SIGILL;
#if ! CONFIG_DARWIN
signallist << SIGRTMIN;
#endif
SignalHandler::Init(signallist);
SignalHandler::SetHandler(SIGUSR1, handleSIGUSR1);
SignalHandler::SetHandler(SIGUSR2, handleSIGUSR2);
@@ -113,7 +113,10 @@ int main(int argc, char *argv[])
#ifndef _WIN32
QList<int> signallist;
signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
<< SIGILL << SIGRTMIN;
<< SIGILL;
#if ! CONFIG_DARWIN
signallist << SIGRTMIN;
#endif
SignalHandler::Init(signallist);
signal(SIGHUP, SIG_IGN);
#endif
@@ -100,7 +100,10 @@ int main(int argc, char **argv)
#ifndef _WIN32
QList<int> signallist;
signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
<< SIGILL << SIGRTMIN;
<< SIGILL;
#if ! CONFIG_DARWIN
signallist << SIGRTMIN;
#endif
SignalHandler::Init(signallist);
signal(SIGHUP, SIG_IGN);
#endif
@@ -105,7 +105,10 @@ int main(int argc, char *argv[])
#ifndef _WIN32
QList<int> signallist;
signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
<< SIGILL << SIGRTMIN;
<< SIGILL;
#if ! CONFIG_DARWIN
signallist << SIGRTMIN;
#endif
SignalHandler::Init(signallist);
SignalHandler::SetHandler(SIGHUP, logSigHup);
#endif
@@ -111,7 +111,10 @@ int main(int argc, char *argv[])
#ifndef _WIN32
QList<int> signallist;
signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
<< SIGILL << SIGRTMIN;
<< SIGILL;
#if ! CONFIG_DARWIN
signallist << SIGRTMIN;
#endif
SignalHandler::Init(signallist);
signal(SIGHUP, SIG_IGN);
#endif
@@ -91,7 +91,10 @@ int main(int argc, char *argv[])
#ifndef _WIN32
QList<int> signallist;
signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
<< SIGILL << SIGRTMIN;
<< SIGILL;
#if ! CONFIG_DARWIN
signallist << SIGRTMIN;
#endif
SignalHandler::Init(signallist);
signal(SIGHUP, SIG_IGN);
#endif
@@ -206,7 +206,10 @@ int main(int argc, char **argv)
#ifndef _WIN32
QList<int> signallist;
signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
<< SIGILL << SIGRTMIN;
<< SIGILL;
#if ! CONFIG_DARWIN
signallist << SIGRTMIN;
#endif
SignalHandler::Init(signallist);
signal(SIGHUP, SIG_IGN);
#endif
@@ -787,7 +787,10 @@ int main(int argc, char **argv)
#ifndef _WIN32
QList<int> signallist;
signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
<< SIGILL << SIGRTMIN;
<< SIGILL;
#if ! CONFIG_DARWIN
signallist << SIGRTMIN;
#endif
SignalHandler::Init(signallist);
signal(SIGHUP, SIG_IGN);
#endif
@@ -377,7 +377,10 @@ int main(int argc, char *argv[])
#ifndef _WIN32
QList<int> signallist;
signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
<< SIGILL << SIGRTMIN;
<< SIGILL;
#if ! CONFIG_DARWIN
signallist << SIGRTMIN;
#endif
SignalHandler::Init(signallist);
signal(SIGHUP, SIG_IGN);
#endif
@@ -287,7 +287,10 @@ int main(int argc, char *argv[])
#ifndef _WIN32
QList<int> signallist;
signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
<< SIGILL << SIGRTMIN;
<< SIGILL;
#if ! CONFIG_DARWIN
signallist << SIGRTMIN;
#endif
SignalHandler::Init(signallist);
signal(SIGHUP, SIG_IGN);
#endif
@@ -6,6 +6,7 @@
#endif
// libmyth* includes
#include "mythconfig.h"
#include "exitcodes.h"
#include "mythcontext.h"
#include "mythversion.h"
@@ -79,7 +80,10 @@ int main(int argc, char *argv[])
#ifndef _WIN32
QList<int> signallist;
signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
<< SIGILL << SIGRTMIN;
<< SIGILL;
#if ! CONFIG_DARWIN
signallist << SIGRTMIN;
#endif
SignalHandler::Init(signallist);
signal(SIGHUP, SIG_IGN);
#endif
@@ -77,7 +77,10 @@ int main(int argc, char **argv)
#ifndef _WIN32
QList<int> signallist;
signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
<< SIGILL << SIGRTMIN;
<< SIGILL;
#if ! CONFIG_DARWIN
signallist << SIGRTMIN;
#endif
SignalHandler::Init(signallist);
signal(SIGHUP, SIG_IGN);
#endif

0 comments on commit 9f65a65

Please sign in to comment.