From 42b1429b37f1365687479764b4524cac913787b7 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 19 Jul 2022 16:47:02 +0100 Subject: Also use binary exit codes in places that terminate abruptly. This is a partial reversion of commit 57330e973b3eb1f2a84803c84daf9d6b420859fd. --- src/inspircd.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/inspircd.cpp') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 0205bd3b6..09cbf99d3 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -167,20 +167,20 @@ namespace if (setgroups(0, NULL) == -1) { ServerInstance->Logs->Log("STARTUP", LOG_DEFAULT, "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->Log("STARTUP", LOG_DEFAULT, "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->Log("STARTUP", LOG_DEFAULT, "setgid(%d) failed (wrong group?): %s", g->gr_gid, strerror(errno)); - exit(EXIT_STATUS_CONFIG); + InspIRCd::QuickExit(EXIT_STATUS_CONFIG); } } @@ -192,13 +192,13 @@ namespace if (!u) { ServerInstance->Logs->Log("STARTUP", LOG_DEFAULT, "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->Log("STARTUP", LOG_DEFAULT, "setuid(%d) failed (wrong user?): %s", u->pw_uid, strerror(errno)); - exit(EXIT_STATUS_CONFIG); + InspIRCd::QuickExit(EXIT_STATUS_CONFIG); } } #endif @@ -262,7 +262,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 { @@ -399,7 +399,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); } } -- cgit v1.3.1-10-gc9f91