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.17 by root, Wed Dec 13 02:55:51 2006 UTC vs.
Revision 1.21 by root, Wed Dec 20 09:14:22 2006 UTC

760 else 760 else
761 { 761 {
762 LOG (llevError, "load_settings: Unknown value for " "real_wiz: %s\n", cp); 762 LOG (llevError, "load_settings: Unknown value for " "real_wiz: %s\n", cp);
763 } 763 }
764 } 764 }
765 else if (!strcasecmp (buf, "recycle_tmp_maps"))
766 {
767 if (!strcasecmp (cp, "on") || !strcasecmp (cp, "true"))
768 {
769 settings.recycle_tmp_maps = TRUE;
770 }
771 else if (!strcasecmp (cp, "off") || !strcasecmp (cp, "false"))
772 {
773 settings.recycle_tmp_maps = FALSE;
774 }
775 else
776 {
777 LOG (llevError, "load_settings: Unknown value for " "recycle_tmp_maps: %s\n", cp);
778 }
779 }
780 else if (!strcasecmp (buf, "explore_mode")) 765 else if (!strcasecmp (buf, "explore_mode"))
781 { 766 {
782 if (!strcasecmp (cp, "on") || !strcasecmp (cp, "true")) 767 if (!strcasecmp (cp, "on") || !strcasecmp (cp, "true"))
783 { 768 {
784 settings.explore_mode = TRUE; 769 settings.explore_mode = TRUE;
1009 else 994 else
1010 { 995 {
1011 LOG (llevError, "Unknown value in settings file: %s\n", buf); 996 LOG (llevError, "Unknown value in settings file: %s\n", buf);
1012 } 997 }
1013 } 998 }
999
1014 close_and_delete (fp, comp); 1000 close_and_delete (fp, comp);
1015} 1001}
1016 1002
1017 1003
1018/* 1004/*
1252/* Signal handlers: */ 1238/* Signal handlers: */
1253 1239
1254void 1240void
1255rec_sigsegv (int i) 1241rec_sigsegv (int i)
1256{ 1242{
1257 LOG (llevError, "\nSIGSEGV received.\n"); 1243 LOG (llevError, "SIGSEGV received.\n");
1258 fatal_signal (1, 1); 1244 fatal_signal (1, 1);
1259} 1245}
1260 1246
1261void 1247void
1262rec_sigint (int i) 1248rec_sigint (int i)
1263{ 1249{
1264 LOG (llevInfo, "\nSIGINT received.\n"); 1250 LOG (llevInfo, "SIGINT received.\n");
1265 fatal_signal (0, 1); 1251 fatal_signal (0, 1);
1266} 1252}
1267 1253
1268void 1254void
1269rec_sighup (int i) 1255rec_sighup (int i)
1270{ 1256{
1271 LOG (llevInfo, "\nSIGHUP received\n"); 1257 LOG (llevInfo, "SIGHUP received\n");
1258
1272 if (init_done) 1259 if (init_done)
1273 {
1274 emergency_save (0);
1275 cleanup (); 1260 cleanup ();
1276 } 1261
1277 exit (0); 1262 exit (0);
1278} 1263}
1279 1264
1280void 1265void
1281rec_sigquit (int i) 1266rec_sigquit (int i)
1282{ 1267{
1283 LOG (llevInfo, "\nSIGQUIT received\n"); 1268 LOG (llevInfo, "SIGQUIT received\n");
1284 fatal_signal (1, 1); 1269 fatal_signal (1, 1);
1285} 1270}
1286 1271
1287void 1272void
1288rec_sigbus (int i) 1273rec_sigbus (int i)
1289{ 1274{
1290#ifdef SIGBUS 1275#ifdef SIGBUS
1291 LOG (llevError, "\nSIGBUS received\n"); 1276 LOG (llevError, "SIGBUS received\n");
1292 fatal_signal (1, 1); 1277 fatal_signal (1, 1);
1293#endif 1278#endif
1294} 1279}
1295 1280
1296void 1281void
1297rec_sigterm (int i) 1282rec_sigterm (int i)
1298{ 1283{
1299 LOG (llevInfo, "\nSIGTERM received\n"); 1284 LOG (llevInfo, "SIGTERM received\n");
1300 fatal_signal (0, 1); 1285 fatal_signal (0, 1);
1301} 1286}
1302 1287
1303void 1288void
1304fatal_signal (int make_core, int close_sockets) 1289fatal_signal (int make_core, int close_sockets)
1305{ 1290{
1306 if (init_done) 1291 cleanup (make_core);
1307 {
1308 emergency_save (0);
1309 clean_tmp_files ();
1310 }
1311 if (make_core)
1312 abort ();
1313 exit (0);
1314} 1292}
1315 1293
1316void 1294void
1317init_signals (void) 1295init_signals (void)
1318{ 1296{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines