make depend added, and catch sigINT to flush log files (I always use ctrl-c when debuging damn it)

This commit is contained in:
fishwaldo 2003-04-11 10:02:31 +00:00
parent 5ed3b7602e
commit fa8ec36422
8 changed files with 65 additions and 34 deletions

View file

@ -17,6 +17,7 @@ NeoStats ChangeLog - Anything we add/remove/fix/change is in here (even our rant
- Started the new logging function, nlog
- Added a function, do_exit, that should be called when exiting NeoStats to flush and close the logs and perform any cleanup that should be done. Hopefully one day we can get rid of the execve code!
- Converted over all log functions to nlog in the core
- Catch SigINT signal as well, so we can flush log files
* NeoStats * Fish * Version 2.5.1
- ConnectServ's username was too long for NeoIRCd, fixed

View file

@ -1,6 +1,6 @@
# Makefile for GeoStats
# GeoStats CVS Identification
# $Id: Makefile.in,v 1.37 2003/04/10 09:32:01 fishwaldo Exp $
# $Id: Makefile.in,v 1.38 2003/04/11 10:02:29 fishwaldo Exp $
# makefile originally created by Andy Church.
include Makefile.inc
@ -41,6 +41,7 @@ libkeeper.a:
utils:
(cd tools; $(MAKE) $@)
clean:
(cd dl; $(MAKE) $@)
(cd adns; $(MAKE) $@)
@ -105,21 +106,21 @@ dist:
# Catch any changes in compilation options at the top of this file
$(OBJS): Makefile
dotconf.o: dotconf.c stats.h config.h dotconf.h Makefile.inc
services.o: services.c stats.h config.h dl.h Unreal.h Ultimate.h Makefile.inc
main.o: main.c stats.h config.h dl.h Makefile.inc
sock.o: sock.c stats.h config.h dl.h Makefile.inc
conf.o: conf.c stats.h config.h dotconf.h dl.h Makefile.inc
ircd.o: ircd.c stats.h config.h dl.h Unreal.h Ultimate.h Makefile.inc
timer.o: timer.c stats.h config.h dl.h Makefile.inc
users.o: users.c stats.h config.h Makefile.inc
ns_help.o: ns_help.c stats.h config.h Makefile.inc
dl.o: dl.c stats.h config.h dl.h Makefile.inc
list.o: list.c list.h Makefile.inc
hash.o: hash.c hash.h Makefile.inc
server.o: server.c stats.h hash.h hash.c config.h Makefile.inc
Ultimate.o: Ultimate.c stats.h Ultimate.h Makefile.inc
Unreal.o: Unreal.c stats.h Unreal.h Makefile.inc
chans.o: hash.c stats.h Makefile.inc
hybrid7.o: hybrid7.c stats.h hybrid7.h Makefile.inc
neoircd.o: neoircd.c stats.h neoircd.h Makefile.inc
dns.o: dns.c stats.h adns/adns.h list.h hash.h config.h neoircd.h log.h
chans.o: chans.c stats.h adns/adns.h list.h hash.h config.h neoircd.h dl.h log.h
dotconf.o: dotconf.c dotconf.h
services.o: services.c stats.h adns/adns.h list.h hash.h config.h neoircd.h dl.h log.h
main.o: main.c stats.h adns/adns.h list.h hash.h config.h neoircd.h dl.h conf.h log.h
sock.o: sock.c stats.h adns/adns.h list.h hash.h config.h neoircd.h dl.h conf.h log.h
conf.o: conf.c stats.h adns/adns.h list.h hash.h config.h neoircd.h dotconf.h conf.h dl.h log.h
ircd.o: ircd.c stats.h adns/adns.h list.h hash.h config.h neoircd.h dl.h log.h
timer.o: timer.c stats.h adns/adns.h list.h hash.h config.h neoircd.h dl.h log.h
users.o: users.c stats.h adns/adns.h list.h hash.h config.h neoircd.h dl.h log.h
ns_help.o: ns_help.c stats.h adns/adns.h list.h hash.h config.h neoircd.h
dl.o: dl.c dl.h hash.h stats.h adns/adns.h list.h config.h neoircd.h log.h
list.o: list.c list.h
hash.o: hash.c hash.h
server.o: server.c stats.h adns/adns.h list.h hash.h config.h neoircd.h log.h
keeper.o: keeper.c stats.h adns/adns.h list.h hash.h config.h neoircd.h keeper/keeper.h conf.h log.h
log.o: log.c stats.h adns/adns.h list.h hash.h config.h neoircd.h conf.h log.h
neoircd.o: neoircd.c stats.h adns/adns.h list.h hash.h config.h neoircd.h hybrid7.h dl.h log.h

View file

@ -17,6 +17,10 @@ libadns.a: $(OBJECTS)
clean:
/bin/rm -rf *.o *.lo *.so *.a
depend:
$(CC) -MM $(INCLUDES) $(CFLAGS) $(SOURCES) > .depend
install:
@ -24,12 +28,12 @@ install:
$(OBJECTS): Makefile ../Makefile.inc
event.o: internal.h tvarith.h adns.h dlist.h config.h
check.o: internal.h adns.h dlist.h config.h
general.o: internal.h adns.h dlist.h config.h
parse.o: internal.h adns.h dlist.h config.h
query.o: internal.h adns.h dlist.h config.h
reply.o: internal.h adns.h dlist.h config.h
setup.o: internal.h adns.h dlist.h config.h
transmit.o: internal.h tvarith.h adns.h dlist.h config.h
types.o: internal.h adns.h dlist.h config.h
check.o: check.c internal.h config.h adns.h dlist.h
event.o: event.c internal.h config.h adns.h dlist.h tvarith.h
general.o: general.c internal.h config.h adns.h dlist.h
parse.o: parse.c internal.h config.h adns.h dlist.h
query.o: query.c internal.h config.h adns.h dlist.h
reply.o: reply.c internal.h config.h adns.h dlist.h
setup.o: setup.c internal.h config.h adns.h dlist.h
transmit.o: transmit.c internal.h config.h adns.h dlist.h tvarith.h
types.o: types.c internal.h config.h adns.h dlist.h

View file

@ -17,6 +17,10 @@ libkeeper.a: $(OBJECTS)
clean:
/bin/rm -rf *.o *.lo *.so *.a
depend:
$(CC) -MM $(INCLUDES) $(CFLAGS) $(SOURCES) > .depend
install:
@ -24,3 +28,12 @@ install:
$(OBJECTS): Makefile ../Makefile.inc
kp_cache.o: kp_cache.c kp_util.h keeper.h ../config.h
kp_dir.o: kp_dir.c kp_util.h keeper.h ../config.h
kp_enum.o: kp_enum.c kp_util.h keeper.h ../config.h
kp_get.o: kp_get.c kp_util.h keeper.h ../config.h
kp_iface.o: kp_iface.c kp_util.h keeper.h ../config.h
kp_recur.o: kp_recur.c kp_util.h keeper.h ../config.h
kp_set.o: kp_set.c kp_util.h keeper.h ../config.h
kp_sort.o: kp_sort.c keeper.h
kp_util.o: kp_util.c kp_util.h keeper.h ../config.h

3
log.c
View file

@ -20,7 +20,7 @@
** USA
**
** NeoStats CVS Identification
** $Id: log.c,v 1.2 2003/04/10 15:26:57 fishwaldo Exp $
** $Id: log.c,v 1.3 2003/04/11 10:02:29 fishwaldo Exp $
*/
#include "stats.h"
@ -59,7 +59,6 @@ void init_logs() {
/* if this fails, no need to call do_exit, as this is the first thing that runs... so nothing to do! */
exit(-1);
}
config.debug = 5;
}
/** @brief Occasionally flush log files out
*/

6
main.c
View file

@ -22,7 +22,7 @@
** USA
**
** NeoStats CVS Identification
** $Id: main.c,v 1.86 2003/04/11 09:26:30 fishwaldo Exp $
** $Id: main.c,v 1.87 2003/04/11 10:02:29 fishwaldo Exp $
*/
#include <setjmp.h>
@ -419,6 +419,9 @@ static void setup_signals()
act.sa_handler = serv_die;
(void)sigaddset(&act.sa_mask, SIGTERM);
(void)sigaction(SIGTERM, &act, NULL);
(void)sigaddset(&act.sa_mask, SIGINT);
(void)sigaction(SIGINT, &act, NULL);
/* handling of SIGSEGV as well -sts */
act.sa_handler = serv_segv;
(void)sigaddset(&act.sa_mask, SIGSEGV);
@ -428,6 +431,7 @@ static void setup_signals()
(void)signal(SIGHUP, conf_rehash);
(void)signal(SIGTERM, serv_die);
(void)signal(SIGSEGV, serv_segv);
(void)signal(SIGINT, serv_die);
}
/** @brief Connects to IRC and starts the main loop

View file

@ -20,12 +20,13 @@ clean:
(cd cfgtool; $(MAKE) $@)
/bin/rm -rf *.o *.lo *.so *.a kptool Makefile
install:
$(OBJECTS): Makefile ../Makefile.inc
kp_exp.c: ../keeper/libkeeper.a ../config.h
kp_imp.c: ../keeper/libkeeper.a ../config.h
kptool.c: ../keeper/libkeeper.a ../config.h
kp_exp.o: kp_exp.c kptool.h ../config.h ../keeper/keeper.h
kp_imp.o: kp_imp.c kptool.h ../config.h ../keeper/keeper.h
kptool.o: kptool.c kptool.h ../config.h ../keeper/keeper.h

View file

@ -19,7 +19,15 @@ clean:
install:
depend:
$(CC) -MM $(INCLUDES) $(CFLAGS) $(KP_SOURCES) > .depend
$(OBJECTS): Makefile ../Makefile.inc
gkeeper.o: gkeeper.c gkeeper.h ../../config.h ../../keeper/keeper.h
tree.o: tree.c gkeeper.h ../../config.h ../../keeper/keeper.h pixmaps/folder_open.xpm pixmaps/folder_closed.xpm pixmaps/book_open.xpm pixmaps/book_closed.xpm pixmaps/string.xpm pixmaps/data.xpm pixmaps/float.xpm pixmaps/num.xpm
edit.o: edit.c gkeeper.h ../../config.h ../../keeper/keeper.h
menu.o: menu.c gkeeper.h ../../config.h ../../keeper/keeper.h
dialog.o: dialog.c gkeeper.h ../../config.h ../../keeper/keeper.h pixmaps/warning.xpm