#include "global.h"
#include "modules.h"
#include "opserv.h"
+#include "spamserv.h"
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#include <sys/wait.h>
#endif
-#ifndef SIGCHLD
-#define SIGCHLD SIGCLD
-#endif
-
#include "main-common.c"
void sigaction_writedb(int x)
int main(int argc, char *argv[])
{
- int daemon, debug;
+ int run_as_daemon;
+ int debug;
pid_t pid = 0;
FILE *file_out;
struct sigaction sv;
GC_enable_incremental();
#endif
- daemon = 1;
+ run_as_daemon = 1;
debug = 0;
tools_init();
debug = 1;
break;
case 'f':
- daemon = 0;
+ run_as_daemon = 0;
break;
case 'v':
version();
* mostly to get the right value of "now" for when we do the
* irc_introduce. */
replay_read_line();
- boot_time = now;
} else {
- boot_time = time(&now);
+ now = time(NULL);
}
+ boot_time = now;
fprintf(stdout, "Initializing daemon...\n");
if (!conf_read(services_config)) {
conf_register_reload(uplink_compile);
- if (daemon) {
+ if (run_as_daemon) {
/* Attempt to fork into the background if daemon mode is on. */
pid = fork();
if (pid < 0) {
fclose(file_out);
}
- if (daemon) {
+ if (run_as_daemon) {
/* Close these since we should not use them from now on. */
fclose(stdin);
fclose(stdout);
free(msg);
}
} else {
- srand(time(&now));
+ now = time(NULL);
+ srand(now);
ioset_run();
}
return 0;