diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-11 16:50:19 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-11 16:50:19 +0000 |
commit | dc2c217824efc9e2f187c35920dbf3738cd97cdf (patch) | |
tree | 7a7111f1cdba0e5e2c682a0e6323f3e41d99819f /crawl-ref/source/mapdef.cc | |
parent | ab686e2d68d7c5fb24b47dd44dbd979842219f54 (diff) | |
download | crawl-ref-dc2c217824efc9e2f187c35920dbf3738cd97cdf.tar.gz crawl-ref-dc2c217824efc9e2f187c35920dbf3738cd97cdf.zip |
Lock before opening .dsc files.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2432 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mapdef.cc')
-rw-r--r-- | crawl-ref/source/mapdef.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc index 847859697d..44e487afd3 100644 --- a/crawl-ref/source/mapdef.cc +++ b/crawl-ref/source/mapdef.cc @@ -1242,8 +1242,10 @@ void map_def::load() { if (!index_only) return; - - const std::string loadfile = get_descache_path(file, ".dsc"); + + const std::string descache_base = get_descache_path(file, ""); + file_lock deslock(descache_base + ".lk", "rb", false); + const std::string loadfile = descache_base + ".dsc"; FILE *inf = fopen(loadfile.c_str(), "rb"); fseek(inf, cache_offset, SEEK_SET); read_full(inf); |