Don't autosave on segfault or after death

This commit is contained in:
John "Elwin" Edwards 2009-10-16 14:40:16 +00:00
parent 2ff3dc0619
commit 67250dfc74
2 changed files with 8 additions and 1 deletions

View file

@ -252,7 +252,9 @@ md_onsignal_autosave(void)
signal(SIGBUS, auto_save);
#endif
#ifdef SIGSEGV
signal(SIGSEGV, auto_save);
/* If there's a segfault, the game state is probably trashed
and there's no point saving it. */
signal(SIGSEGV, SIG_DFL);
#endif
#ifdef SIGSYS
signal(SIGSYS, auto_save);

View file

@ -55,6 +55,11 @@ death(int monst)
time_t date;
char buf[80];
/* Don't autosave dead games. It would be a good idea to autosave a
game that is between death and scoreboard write, but the restore
code can't handle that case yet. */
md_onsignal_default();
time(&date);
lt = localtime(&date);
clear();