X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fircd.c;h=db6c6040f38aabf9d9a7a3d4fc95d14e170f14a5;hb=3c2123a15ed3dea068e34bdedd9b07aa43d4c927;hp=363903ebdde8a37f30a4b5e9f8f18d85324795db;hpb=4ddb9ef738de99a6ef18765cc3ac8c476152e4e4;p=ircu2.10.12-pk.git diff --git a/ircd/ircd.c b/ircd/ircd.c index 363903e..db6c604 100644 --- a/ircd/ircd.c +++ b/ircd/ircd.c @@ -464,7 +464,7 @@ static void parse_command_line(int argc, char** argv) { */ while ((opt = getopt(argc, argv, options)) != EOF) switch (opt) { - case 'k': thisServer.bootopt |= BOOT_CHKCONF; break; + case 'k': thisServer.bootopt |= BOOT_CHKCONF | BOOT_TTY; break; case 'n': case 't': thisServer.bootopt |= BOOT_TTY; break; case 'd': dpath = optarg; break; @@ -639,6 +639,11 @@ int main(int argc, char **argv) { close_connections(!(thisServer.bootopt & (BOOT_DEBUG | BOOT_TTY | BOOT_CHKCONF))); + /* daemon_init() must be before event_init() because kqueue() FDs + * are, perversely, not inherited across fork(). + */ + daemon_init(thisServer.bootopt & BOOT_TTY); + event_init(MAXCONNECTIONS); setup_signals(); @@ -677,7 +682,6 @@ int main(int argc, char **argv) { } debug_init(thisServer.bootopt & BOOT_TTY); - daemon_init(thisServer.bootopt & BOOT_TTY); if (check_pid()) { Debug((DEBUG_FATAL, "Failed to acquire PID file lock after fork")); exit(2);