ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/init.C
(Generate patch)

Comparing deliantra/server/server/init.C (file contents):
Revision 1.2 by root, Thu Aug 24 13:13:49 2006 UTC vs.
Revision 1.3 by root, Tue Aug 29 05:03:55 2006 UTC

1/* 1/*
2 * static char *rcsid_init_c = 2 * static char *rcsid_init_c =
3 * "$Id: init.C,v 1.2 2006/08/24 13:13:49 root Exp $"; 3 * "$Id: init.C,v 1.3 2006/08/29 05:03:55 root Exp $";
4 */ 4 */
5 5
6/* 6/*
7 CrossFire, A Multiplayer game for X-windows 7 CrossFire, A Multiplayer game for X-windows
8 8
960void rec_sigquit(int i) { 960void rec_sigquit(int i) {
961 LOG(llevInfo,"\nSIGQUIT received\n"); 961 LOG(llevInfo,"\nSIGQUIT received\n");
962 fatal_signal(1, 1); 962 fatal_signal(1, 1);
963} 963}
964 964
965void rec_sigpipe(int i) {
966
967/* Keep running if we receive a sigpipe. Crossfire should really be able
968 * to handle this signal (at least at some point in the future if not
969 * right now). By causing a dump right when it is received, it is not
970 * doing much good. However, if it core dumps later on, at least it can
971 * be looked at later on, and maybe fix the problem that caused it to
972 * dump core. There is no reason that SIGPIPES should be fatal
973 */
974 LOG(llevError,"\nSIGPIPE--------------\n------------\n--------\n---\n");
975#if 1 && !defined(WIN32) /* ***win32: we don't want send SIGPIPE */
976 LOG(llevInfo,"\nReceived SIGPIPE, ignoring...\n");
977 signal(SIGPIPE,rec_sigpipe);/* hocky-pux clears signal handlers */
978#else
979 LOG(llevError,"\nSIGPIPE received, not ignoring...\n");
980 fatal_signal(1, 1); /*Might consider to uncomment this line */
981#endif
982}
983
984void rec_sigbus(int i) { 965void rec_sigbus(int i) {
985#ifdef SIGBUS 966#ifdef SIGBUS
986 LOG(llevError,"\nSIGBUS received\n"); 967 LOG(llevError,"\nSIGBUS received\n");
987 fatal_signal(1, 1); 968 fatal_signal(1, 1);
988#endif 969#endif
1005 986
1006void init_signals(void) { 987void init_signals(void) {
1007#ifndef WIN32 /* init_signals() remove signals */ 988#ifndef WIN32 /* init_signals() remove signals */
1008 signal(SIGHUP,rec_sighup); 989 signal(SIGHUP,rec_sighup);
1009 signal(SIGINT,rec_sigint); 990 signal(SIGINT,rec_sigint);
1010#ifndef DEBUG
1011 signal(SIGQUIT,rec_sigquit); 991 signal(SIGQUIT,rec_sigquit);
1012 signal(SIGSEGV,rec_sigsegv); 992 signal(SIGSEGV,rec_sigsegv);
1013 LOG(llevInfo,"\n---------registering SIGPIPE\n"); 993 signal(SIGPIPE,SIG_IGN);
1014 signal(SIGPIPE,rec_sigpipe);
1015#ifdef SIGBUS 994#ifdef SIGBUS
1016 signal(SIGBUS,rec_sigbus); 995 signal(SIGBUS,rec_sigbus);
1017#endif 996#endif
1018 signal(SIGTERM,rec_sigterm); 997 signal(SIGTERM,rec_sigterm);
1019#endif 998#endif
1020#endif /* win32 */
1021} 999}
1022 1000
1023/* init_races() - reads the races file in the lib/ directory, then 1001/* init_races() - reads the races file in the lib/ directory, then
1024 * overwrites old 'race' entries. This routine allow us to quickly 1002 * overwrites old 'race' entries. This routine allow us to quickly
1025 * re-configure the 'alignment' of monsters, objects. Useful for 1003 * re-configure the 'alignment' of monsters, objects. Useful for

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines