aboutsummaryrefslogtreecommitdiff
path: root/src/server.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-07-19 16:25:28 +0100
committerGravatar Sadie Powell2022-07-19 16:30:23 +0100
commitf3fa07f776e208bb8933b3edb4b47baa886187c0 (patch)
treee2762dfe4db5e0d7c60b870b74d207a47b1cd91e /src/server.cpp
parentAllow logrotate to rotate logs with just a pid file. (diff)
Allow forcing binary exit codes at compile time.
This is useful with some init systems that handle our exit codes strangely.
Diffstat (limited to 'src/server.cpp')
-rw-r--r--src/server.cpp8
1 files changed, 7 insertions, 1 deletions
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)