From f7a5b4fa74192338012b5174748e2ce4d796d46d Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Thu, 30 May 2019 21:24:08 +0100 Subject: Ignore SIGUSR1 and SIGUSR2 by default. This stops users from accidentally killing their IRC server if they forget to load the sslrehashsignal module. --- src/inspircd.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/inspircd.cpp') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index b6c252104..c5d958f87 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -121,10 +121,11 @@ void InspIRCd::SetSignals() { #ifndef _WIN32 signal(SIGALRM, SIG_IGN); + signal(SIGCHLD, SIG_IGN); signal(SIGHUP, InspIRCd::SetSignal); signal(SIGPIPE, SIG_IGN); - signal(SIGCHLD, SIG_IGN); - /* We want E2BIG not a signal! */ + signal(SIGUSR1, SIG_IGN); + signal(SIGUSR2, SIG_IGN); signal(SIGXFSZ, SIG_IGN); #endif signal(SIGTERM, InspIRCd::SetSignal); -- cgit v1.3.1-10-gc9f91 From 5b152cfcd993119c0d0ef87b73b3b0f20c940cdc Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Thu, 20 Jun 2019 10:24:16 +0100 Subject: Deduplicate dirent.h inclusion. --- include/fileutils.h | 4 ---- src/fileutils.cpp | 4 ++++ src/inspircd.cpp | 1 - src/modules.cpp | 4 ---- 4 files changed, 4 insertions(+), 9 deletions(-) (limited to 'src/inspircd.cpp') diff --git a/include/fileutils.h b/include/fileutils.h index 9623a548d..e50cc8c34 100644 --- a/include/fileutils.h +++ b/include/fileutils.h @@ -19,10 +19,6 @@ #pragma once -#ifndef _WIN32 -# include -#endif - /** Provides an easy method of reading a text file into memory. */ class CoreExport FileReader { diff --git a/src/fileutils.cpp b/src/fileutils.cpp index d5e1e5839..6c98ba300 100644 --- a/src/fileutils.cpp +++ b/src/fileutils.cpp @@ -21,6 +21,10 @@ #include +#ifndef _WIN32 +# include +#endif + FileReader::FileReader(const std::string& filename) { Load(filename); diff --git a/src/inspircd.cpp b/src/inspircd.cpp index c5d958f87..29cd8acf2 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -30,7 +30,6 @@ #include #ifndef _WIN32 - #include #include #include #include diff --git a/src/modules.cpp b/src/modules.cpp index 67ebc3439..444e90645 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -28,10 +28,6 @@ #include "exitcodes.h" #include -#ifndef _WIN32 - #include -#endif - static insp::intrusive_list* dynrefs = NULL; void dynamic_reference_base::reset_all() -- cgit v1.3.1-10-gc9f91 From ce6c5fc3de38ab42173d85c3c91bb2ac34a0f792 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Wed, 3 Jul 2019 09:59:46 +0100 Subject: Fix not expanding correctly. --- src/inspircd.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/inspircd.cpp') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 29cd8acf2..70e5fcf38 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -190,9 +190,7 @@ void InspIRCd::WritePID(const std::string& filename, bool exitonfail) return; } - std::string fname(filename); - if (fname.empty()) - fname = ServerInstance->Config->Paths.PrependData("inspircd.pid"); + std::string fname = ServerInstance->Config->Paths.PrependData(filename.empty() ? "inspircd.pid" : filename); std::ofstream outfile(fname.c_str()); if (outfile.is_open()) { -- cgit v1.3.1-10-gc9f91