#include <fcntl.h>
#include <errno.h>
#include <signal.h>
-#include <execinfo.h>
+#ifdef SENF_DEBUG
+ #include <execinfo.h>
+#endif
#include <sstream>
#include <algorithm>
#include <boost/algorithm/string/predicate.hpp>
{
// int i (not unsigned) since argc_ is int ...
for (int i (1); i<argc_; ++i) {
- if (argv_[i] == std::string("--no-daemon"))
+ std::string argv (argv_[i]);
+ if (argv == "--no-daemon")
daemonize(false);
- else if (boost::starts_with(argv_[i], std::string("--console-log="))) {
- std::string arg (std::string(argv_[i]).substr(14u));
+ else if (boost::starts_with(argv, "--console-log=")) {
+ std::string arg (argv.substr(14u));
std::string::size_type komma (arg.find(','));
if (komma == std::string::npos) {
boost::trim(arg);
else if (! arg2.empty() ) consoleLog(arg2, StdErr);
}
}
- else if (boost::starts_with(argv_[i], std::string("--pid-file=")))
+ else if (boost::starts_with(argv, "--pid-file="))
pidFile(std::string(std::string(argv_[i]), 11u));
}
}
::sigaction(SIGFPE, &sa, NULL);
::sigaction(SIGBUS, &sa, NULL);
::sigaction(SIGSEGV, &sa, NULL);
+#ifdef SIGSTKFLT //SIGSTKFLT is used for stack faults on coprocessors. That condition doesn't exist on MIPS
::sigaction(SIGSTKFLT, &sa, NULL);
+#endif
::sigaction(SIGSYS, &sa, NULL);
::sigaction(SIGUSR2, &sa, NULL);
#endif