From 3156c2e3bc0d513a4332c7f472fd6b9b31a5094e Mon Sep 17 00:00:00 2001 From: dshaligram Date: Tue, 19 Dec 2006 13:17:13 +0000 Subject: Handle SIGHUP. Could use improvement, but it's a start. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@673 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/hiscores.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/hiscores.cc') diff --git a/crawl-ref/source/hiscores.cc b/crawl-ref/source/hiscores.cc index c0ccd75e43..27031e7337 100644 --- a/crawl-ref/source/hiscores.cc +++ b/crawl-ref/source/hiscores.cc @@ -105,6 +105,8 @@ std::string log_file_name() void hiscores_new_entry( const scorefile_entry &ne ) { + unwind_bool score_update(crawl_state.updating_scores, true); + FILE *scores; int i, total_entries; bool inserted = false; @@ -175,6 +177,8 @@ void hiscores_new_entry( const scorefile_entry &ne ) void logfile_new_entry( const scorefile_entry &ne ) { + unwind_bool logfile_update(crawl_state.updating_scores, true); + FILE *logfile; scorefile_entry le = ne; @@ -225,6 +229,8 @@ static void hiscores_print_entry(const scorefile_entry &se, // Writes all entries in the scorefile to stdout in human-readable form. void hiscores_print_all(int display_count, int format) { + unwind_bool scorefile_display(crawl_state.updating_scores, true); + FILE *scores = hs_open("r", score_file_name()); if (scores == NULL) { @@ -249,6 +255,8 @@ void hiscores_print_all(int display_count, int format) // hiscores_print_all. void hiscores_print_list( int display_count, int format ) { + unwind_bool scorefile_display(crawl_state.updating_scores, true); + FILE *scores; int i, total_entries; @@ -437,8 +445,6 @@ static bool unlock_file_handle( FILE *handle ) #endif - - FILE *hs_open( const char *mode, const std::string &scores ) { // allow reading from standard input -- cgit v1.2.3-54-g00ecf