summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/hiscores.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-12-19 13:17:13 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-12-19 13:17:13 +0000
commit3156c2e3bc0d513a4332c7f472fd6b9b31a5094e (patch)
tree122c5ac4494f743e2613176c9ed5d83daad1d480 /crawl-ref/source/hiscores.cc
parentbb1a887fb819272e46b5f593d2a2debf81a802ad (diff)
downloadcrawl-ref-3156c2e3bc0d513a4332c7f472fd6b9b31a5094e.tar.gz
crawl-ref-3156c2e3bc0d513a4332c7f472fd6b9b31a5094e.zip
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
Diffstat (limited to 'crawl-ref/source/hiscores.cc')
-rw-r--r--crawl-ref/source/hiscores.cc10
1 files changed, 8 insertions, 2 deletions
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