aboutsummaryrefslogtreecommitdiff
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-07-19 17:00:23 +0100
committerGravatar Sadie Powell2022-07-19 17:00:23 +0100
commitb763b1e69e58de3d7895354682b9f8e484d7e981 (patch)
treee0f978e310f05cf3293c82ebae461fc469ab6756 /src/inspircd.cpp
parentAllow remote servers to specify the context of a message. (diff)
parentAlso use binary exit codes in places that terminate abruptly. (diff)
Merge branch 'insp3' into master.
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 3b6e3c3e7..ddad6cfc7 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -157,20 +157,20 @@ namespace
if (setgroups(0, NULL) == -1)
{
ServerInstance->Logs.Normal("STARTUP", "setgroups() failed (wtf?): %s", strerror(errno));
- exit(EXIT_STATUS_CONFIG);
+ InspIRCd::QuickExit(EXIT_STATUS_CONFIG);
}
struct group* g = getgrnam(SetGroup.c_str());
if (!g)
{
ServerInstance->Logs.Normal("STARTUP", "getgrnam(%s) failed (wrong group?): %s", SetGroup.c_str(), strerror(errno));
- exit(EXIT_STATUS_CONFIG);
+ InspIRCd::QuickExit(EXIT_STATUS_CONFIG);
}
if (setgid(g->gr_gid) == -1)
{
ServerInstance->Logs.Normal("STARTUP", "setgid(%d) failed (wrong group?): %s", g->gr_gid, strerror(errno));
- exit(EXIT_STATUS_CONFIG);
+ InspIRCd::QuickExit(EXIT_STATUS_CONFIG);
}
}
@@ -182,13 +182,13 @@ namespace
if (!u)
{
ServerInstance->Logs.Normal("STARTUP", "getpwnam(%s) failed (wrong user?): %s", SetUser.c_str(), strerror(errno));
- exit(EXIT_STATUS_CONFIG);
+ InspIRCd::QuickExit(EXIT_STATUS_CONFIG);
}
if (setuid(u->pw_uid) == -1)
{
ServerInstance->Logs.Normal("STARTUP", "setuid(%d) failed (wrong user?): %s", u->pw_uid, strerror(errno));
- exit(EXIT_STATUS_CONFIG);
+ InspIRCd::QuickExit(EXIT_STATUS_CONFIG);
}
}
#endif
@@ -253,7 +253,7 @@ namespace
// happened and the parent should exit.
while (kill(childpid, 0) != -1)
sleep(1);
- exit(EXIT_STATUS_NOERROR);
+ InspIRCd::QuickExit(EXIT_STATUS_NOERROR);
}
else
{
@@ -400,7 +400,7 @@ namespace
// Required for returning the proper value of EXIT_SUCCESS for the parent process.
void VoidSignalHandler(int)
{
- exit(EXIT_STATUS_NOERROR);
+ InspIRCd::QuickExit(EXIT_STATUS_NOERROR);
}
}