diff options
author | Adam Borowski <kilobyte@angband.pl> | 2010-09-06 11:17:44 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2010-09-06 11:17:44 +0200 |
commit | 19306ea694ef6bb12ca341c91ea5eff1672b8720 (patch) | |
tree | 23afa6f11d8f09d43dae7439f1d6068863af4643 /crawl-ref/source/package.cc | |
parent | 9ab615828b5f5fb72a96ac72ffc369b8b341ed08 (diff) | |
download | crawl-ref-19306ea694ef6bb12ca341c91ea5eff1672b8720.tar.gz crawl-ref-19306ea694ef6bb12ca341c91ea5eff1672b8720.zip |
Fix the save browser on non-Windows.
Diffstat (limited to 'crawl-ref/source/package.cc')
-rw-r--r-- | crawl-ref/source/package.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crawl-ref/source/package.cc b/crawl-ref/source/package.cc index 2d505da240..fd5816269b 100644 --- a/crawl-ref/source/package.cc +++ b/crawl-ref/source/package.cc @@ -101,6 +101,9 @@ package::package(const char* file, bool writeable, bool empty) if (fd == -1) sysfail("can't create save file (%s)", file); + if (!lock_file(fd, true)) + sysfail("failed to lock newly created save (%s)", file); + dirty = true; file_len = sizeof(file_header); } @@ -110,7 +113,7 @@ package::package(const char* file, bool writeable, bool empty) if (fd == -1) sysfail("can't open save file (%s)", file); - if (!lock_file(fd)) + if (!lock_file(fd, writeable)) fail("Another game is already in progress using this save!"); file_header head; |