|
|
1 | |
1 | /* |
2 | /* |
2 | * static char *rcsid_glue_c = |
3 | * static char *rcsid_glue_c = |
3 | * "$Id: glue.C,v 1.1 2006/08/13 17:16:00 elmex Exp $"; |
4 | * "$Id: glue.C,v 1.2 2006/09/10 16:00:23 root Exp $"; |
4 | */ |
5 | */ |
5 | |
6 | |
6 | /* |
7 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
8 | CrossFire, A Multiplayer game for X-windows |
8 | |
9 | |
… | |
… | |
36 | * |
37 | * |
37 | * Glue has been cleaned, so this file is almost empty now :) |
38 | * Glue has been cleaned, so this file is almost empty now :) |
38 | * Ryo 2005-07-15 |
39 | * Ryo 2005-07-15 |
39 | */ |
40 | */ |
40 | |
41 | |
41 | static const char* const fatalmsgs[80]={ |
42 | static const char *const fatalmsgs[80] = { |
42 | "Failed to allocate memory", |
43 | "Failed to allocate memory", |
43 | "Failed repeatedly to load maps", |
44 | "Failed repeatedly to load maps", |
44 | "Hashtable for archetypes is too small", |
45 | "Hashtable for archetypes is too small", |
45 | "Too many errors" |
46 | "Too many errors" |
46 | }; |
47 | }; |
47 | |
48 | |
48 | /* |
49 | /* |
49 | * fatal() is meant to be called whenever a fatal signal is intercepted. |
50 | * fatal() is meant to be called whenever a fatal signal is intercepted. |
50 | * It will call the emergency_save and the clean_tmp_files functions. |
51 | * It will call the emergency_save and the clean_tmp_files functions. |
51 | */ |
52 | */ |
|
|
53 | void |
52 | void fatal(int err) { |
54 | fatal (int err) |
|
|
55 | { |
53 | fprintf(logfile,"Fatal: %s\n",fatalmsgs[err]); |
56 | fprintf (logfile, "Fatal: %s\n", fatalmsgs[err]); |
54 | emergency_save(0); |
57 | emergency_save (0); |
55 | clean_tmp_files(); |
58 | clean_tmp_files (); |
56 | fprintf(logfile,"Exiting...\n"); |
59 | fprintf (logfile, "Exiting...\n"); |
57 | exit(err); |
60 | exit (err); |
58 | } |
61 | } |