From f3fa07f776e208bb8933b3edb4b47baa886187c0 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 19 Jul 2022 16:25:28 +0100 Subject: Allow forcing binary exit codes at compile time. This is useful with some init systems that handle our exit codes strangely. --- src/server.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server.cpp b/src/server.cpp index 46ed9e9ff..ccc572553 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -56,7 +56,13 @@ void InspIRCd::Exit(int status) this->Cleanup(); ServerInstance = NULL; delete this; - exit (status); + +#ifdef INSPIRCD_BINARY_EXIT + // Some init systems handle non-binary exit statuses weirdly. + exit(status ? EXIT_FAILURE : EXIT_SUCCESS); +#else + exit(status); +#endif } void InspIRCd::Rehash(const std::string& uuid) -- cgit v1.3.1-10-gc9f91