summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/package.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2010-12-03 00:19:09 +0100
committerAdam Borowski <kilobyte@angband.pl>2010-12-03 00:19:09 +0100
commit65cf2bb0693c4f1b46e68108407d50a858330c20 (patch)
treee5cb5812f9e5dad525505284d028766e74dbb3a7 /crawl-ref/source/package.cc
parent5f6c2d3dee17a4cb7783bbc04ed902555313b54a (diff)
downloadcrawl-ref-65cf2bb0693c4f1b46e68108407d50a858330c20.tar.gz
crawl-ref-65cf2bb0693c4f1b46e68108407d50a858330c20.zip
Except for public servers, ensure robustness against filesystem crashes.
On a busy disk, this can cause a pause of several seconds -- or a spin-up on a laptop. Still, people do lose games to crashes from time to time. This commit sacrifices performance for a full guarantee against system or power crashes, as long as the underlying fsync() implementation isn't broken (many network filesystems and certain ATA disks). Neither CAO nor CDO ever had a system crash, so we give a guarantee against Crawl's crashes only. As long as writes are not maliciously reordered, this should be enough. With the loads they experience during the Tourney, fsync()s would be murder. (What about emergency saves? They can write possibly tainted data during a crash, claiming it's kosher.)
Diffstat (limited to 'crawl-ref/source/package.cc')
-rw-r--r--crawl-ref/source/package.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/crawl-ref/source/package.cc b/crawl-ref/source/package.cc
index d89cb00d6e..bd98d97512 100644
--- a/crawl-ref/source/package.cc
+++ b/crawl-ref/source/package.cc
@@ -38,9 +38,13 @@ Caveats/issues:
#include "errors.h"
#include "syscalls.h"
+#ifndef DGAMELAUNCH
+#define DO_FSYNC
+#endif
+
+// debugging defines
#undef FSCK_VERBOSE
#undef COSTLY_ASSERTS
-#undef DO_FSYNC
#undef DEBUG_PACKAGE
static len_t htole(len_t x)