diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | include/config.h.in | 3 | ||||
| -rw-r--r-- | include/inspircd.h | 7 | ||||
| -rw-r--r-- | include/modules.h | 3 |
4 files changed, 13 insertions, 1 deletions
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 3790a782d..f0714cbcf 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -22,6 +22,7 @@ endif() check_function_exists("arc4random_buf" HAS_ARC4RANDOM_BUF) check_function_exists("clock_gettime" HAS_CLOCK_GETTIME) +check_function_exists("close_range" HAS_CLOSE_RANGE) check_function_exists("getentropy" HAS_GETENTROPY) configure_file("config.h.in" "config.h") diff --git a/include/config.h.in b/include/config.h.in index 028c932df..fbb82f367 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -58,6 +58,9 @@ // Whether the arc4random_buf() function was available at compile time. #cmakedefine HAS_ARC4RANDOM_BUF +// Whether the close_range() function was available at compile time. +#cmakedefine HAS_CLOSE_RANGE + // Whether the clock_gettime() function was available at compile time. #cmakedefine HAS_CLOCK_GETTIME diff --git a/include/inspircd.h b/include/inspircd.h index 470500f64..6c653f04e 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -396,6 +396,13 @@ public: [[noreturn]] static void QuickExit(int status, const std::string& reason = "", const std::string& logtype = ""); + /** Causes the server to restart after unloading modules and closing all open file descriptors. + * @param reason If non-empty then the reason the server is exiting. + * @param logtype If non-empty then the log type to log the exit reason as. + * @return If this function returns then the restart failed and the return value contains the reason why. + */ + std::string Restart(const std::string& reason = "", const std::string& logtype = ""); + /** Stores an incoming signal when received from the operating system. * @param signal The signal received from the operating system. */ diff --git a/include/modules.h b/include/modules.h index dd45c6f09..bbbb209b2 100644 --- a/include/modules.h +++ b/include/modules.h @@ -917,8 +917,9 @@ public: /** Called before a server shuts down. * @param reason The reason the server is shutting down. + * @param restarting Whether the server is restarting. */ - virtual void OnShutdown(const std::string& reason); + virtual void OnShutdown(const std::string& reason, bool restarting); /** Called when a local user is attempting to log in to an server operator account. * @param user The user who is attempting to log in. |
