summaryrefslogtreecommitdiff
path: root/src/init.c
diff options
context:
space:
mode:
authorgeniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2005-06-03 14:27:40 +0000
committergeniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2005-06-03 14:27:40 +0000
commite0cba0bb71611f82434b7f061760d105423bbe09 (patch)
tree7f1d58a67896f98bddc28077c51325bc0d0423a0 /src/init.c
parent31163a2cbcf66af94976f53d4712e4b66a4e7fdc (diff)
BUILD : 1.7.10 (823) BUGS : 385 391 NOTES : Moved checks for UseTokens, UseTS6, and Numeric into protocol_module_init because they need the ircd struct, and split init() into two functions to load the protocol module for listnicks/listchans.
git-svn-id: svn://svn.anope.org/anope/trunk@823 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@576 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/init.c')
-rw-r--r--src/init.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/init.c b/src/init.c
index 33c4b3dcd..2171be697 100644
--- a/src/init.c
+++ b/src/init.c
@@ -398,12 +398,12 @@ static void write_pidfile(void)
/*************************************************************************/
-/* Overall initialization routine. Returns 0 on success, -1 on failure. */
+/* Overall initialization routines. Return 0 on success, -1 on failure. */
-int init(int ac, char **av)
+int openlog_failed = 0, openlog_errno = 0;
+
+int init_primary(int ac, char **av)
{
- int i;
- int openlog_failed = 0, openlog_errno = 0;
int started_from_term = isatty(0) && isatty(1) && isatty(2);
/* Set file creation mask and group ID. */
@@ -438,6 +438,18 @@ int init(int ac, char **av)
return -1;
}
+ /* Add IRCD Protocol Module; exit if there are errors */
+ if (protocol_module_init()) {
+ return -1;
+ }
+
+ return 0;
+}
+
+int init_secondary(int ac, char **av)
+{
+ int i;
+ int started_from_term = isatty(0) && isatty(1) && isatty(2);
/* Add Core MSG handles */
moduleAddMsgs();
@@ -445,10 +457,6 @@ int init(int ac, char **av)
/* Parse all remaining command-line options. */
parse_options(ac, av);
- /* Add IRCD Protocol Module; exit if there are errors */
- if (protocol_module_init()) {
- return -1;
- }
#ifndef _WIN32
if (!nofork) {
if ((i = fork()) < 0) {
@@ -482,7 +490,6 @@ int init(int ac, char **av)
}
#endif
-
/* Write our PID to the PID file. */
write_pidfile();