# HG changeset patch # User edwarj4 # Date 1255704016 0 # Node ID d388234c4ce99096830ae1907a23127b5e847f09 # Parent 9a2c0c60c3863fc0932539cd1f64069972519d50 Don't autosave on segfault or after death diff -r 9a2c0c60c386 -r d388234c4ce9 rogue3/mdport.c --- a/rogue3/mdport.c Fri Oct 16 14:30:06 2009 +0000 +++ b/rogue3/mdport.c Fri Oct 16 14:40:16 2009 +0000 @@ -252,7 +252,9 @@ 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); diff -r 9a2c0c60c386 -r d388234c4ce9 rogue3/rip.c --- a/rogue3/rip.c Fri Oct 16 14:30:06 2009 +0000 +++ b/rogue3/rip.c Fri Oct 16 14:40:16 2009 +0000 @@ -55,6 +55,11 @@ 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();