diff options
author | Adam Borowski <kilobyte@angband.pl> | 2010-12-03 00:19:09 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2010-12-03 00:19:09 +0100 |
commit | 65cf2bb0693c4f1b46e68108407d50a858330c20 (patch) | |
tree | e5cb5812f9e5dad525505284d028766e74dbb3a7 /crawl-ref/source/package.cc | |
parent | 5f6c2d3dee17a4cb7783bbc04ed902555313b54a (diff) | |
download | crawl-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.cc | 6 |
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) |