| 1372 | |
| 1373 | #ifdef INSURANCE |
| 1374 | void |
| 1375 | save_currentstate(void) |
| 1376 | { |
| 1377 | NHFILE *nhfp; |
| 1378 | |
| 1379 | program_state.in_checkpoint++; |
| 1380 | if (flags.ins_chkpt) { |
| 1381 | /* write out just-attained level, with pets and everything */ |
| 1382 | nhfp = currentlevel_rewrite(); |
| 1383 | if (!nhfp) |
| 1384 | return; |
| 1385 | if (nhfp->structlevel) |
| 1386 | bufon(nhfp->fd); |
| 1387 | nhfp->mode = WRITING; |
| 1388 | savelev(nhfp,ledger_no(&u.uz)); |
| 1389 | close_nhfile(nhfp); |
| 1390 | } |
| 1391 | |
| 1392 | /* write out non-level state */ |
| 1393 | savestateinlock(); |
| 1394 | program_state.in_checkpoint--; |
| 1395 | } |
| 1396 | #endif |
| 1397 | |
| 1398 | /* |
no test coverage detected