… | |
… | |
1221 | LOG (llevError, "SIGSEGV received.\n"); |
1221 | LOG (llevError, "SIGSEGV received.\n"); |
1222 | cleanup ("SIGSEGV received", 1); |
1222 | cleanup ("SIGSEGV received", 1); |
1223 | } |
1223 | } |
1224 | |
1224 | |
1225 | void |
1225 | void |
1226 | rec_sigint (int i) |
|
|
1227 | { |
|
|
1228 | LOG (llevInfo, "SIGINT received.\n"); |
|
|
1229 | cleanup ("SIGINT received", 0); |
|
|
1230 | } |
|
|
1231 | |
|
|
1232 | void |
|
|
1233 | rec_sighup (int i) |
|
|
1234 | { |
|
|
1235 | LOG (llevInfo, "SIGHUP received\n"); |
|
|
1236 | |
|
|
1237 | cleanup ("SIGHUP received", 0); |
|
|
1238 | } |
|
|
1239 | |
|
|
1240 | void |
|
|
1241 | rec_sigquit (int i) |
1226 | rec_sigquit (int i) |
1242 | { |
1227 | { |
1243 | LOG (llevInfo, "SIGQUIT received\n"); |
1228 | LOG (llevInfo, "SIGQUIT received\n"); |
1244 | cleanup ("SIGQUIT received", 1); |
1229 | cleanup ("SIGQUIT received", 1); |
1245 | } |
1230 | } |
… | |
… | |
1250 | LOG (llevError, "SIGBUS received\n"); |
1235 | LOG (llevError, "SIGBUS received\n"); |
1251 | cleanup ("SIGBUS received", 1); |
1236 | cleanup ("SIGBUS received", 1); |
1252 | } |
1237 | } |
1253 | |
1238 | |
1254 | void |
1239 | void |
1255 | rec_sigterm (int i) |
|
|
1256 | { |
|
|
1257 | LOG (llevInfo, "SIGTERM received\n"); |
|
|
1258 | cleanup ("SIGTERM received", 0); |
|
|
1259 | } |
|
|
1260 | |
|
|
1261 | void |
|
|
1262 | init_signals (void) |
1240 | init_signals (void) |
1263 | { |
1241 | { |
1264 | signal (SIGPIPE, SIG_IGN); |
1242 | signal (SIGPIPE, SIG_IGN); |
1265 | signal (SIGHUP, rec_sighup); |
|
|
1266 | signal (SIGINT, rec_sigint); |
|
|
1267 | signal (SIGQUIT, rec_sigquit); |
1243 | signal (SIGQUIT, rec_sigquit); |
1268 | signal (SIGSEGV, rec_sigsegv); |
1244 | signal (SIGSEGV, rec_sigsegv); |
1269 | signal (SIGBUS, rec_sigbus); |
1245 | signal (SIGBUS, rec_sigbus); |
1270 | signal (SIGTERM, rec_sigterm); |
|
|
1271 | } |
1246 | } |
1272 | |
1247 | |
1273 | /* init_races() - reads the races file in the lib/ directory, then |
1248 | /* init_races() - reads the races file in the lib/ directory, then |
1274 | * overwrites old 'race' entries. This routine allow us to quickly |
1249 | * overwrites old 'race' entries. This routine allow us to quickly |
1275 | * re-configure the 'alignment' of monsters, objects. Useful for |
1250 | * re-configure the 'alignment' of monsters, objects. Useful for |