]>
jfr.im git - irc/quakenet/newserv.git/blob - core/main.c
1 #include "../lib/sstring.h"
16 int newserv_shutdown_pending
;
17 int newserv_sigusr1_pending
;
21 void siginthandler(int sig
);
22 void sigusr1handler(int sig
);
24 int main(int argc
, char **argv
) {
37 initconfig("newserv.conf");
40 /* Loading the modules will bring in the bulk of the code */
42 signal(SIGINT
, siginthandler
);
43 signal(SIGUSR1
, sigusr1handler
);
48 doscheduledevents(time(NULL
));
49 if (newserv_shutdown_pending
) {
54 if (newserv_sigusr1_pending
) {
55 signal(SIGUSR1
, sigusr1handler
);
56 triggerhook(HOOK_CORE_SIGUSR1
, NULL
);
57 newserv_sigusr1_pending
=0;
68 * seed the pseudo-random number generator, rand()
73 gettimeofday(&t
, NULL
);
77 void siginthandler(int sig
) {
78 newserv_shutdown_pending
= 1;
81 void sigusr1handler(int sig
) {
82 newserv_sigusr1_pending
= 1;