diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2011-02-12 21:26:08 -0800 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2011-02-12 21:26:08 -0800 |
commit | 625aabedd04172aa57b9903ff328375c4c9fa828 (patch) | |
tree | 62bbbc4185d7dfae45d4a3bb756e0d18ab2b64dc | |
parent | 2530ab22f56855b2f137c65cf454311fc9824c77 (diff) |
Support ftruncate error conditions.
-rw-r--r-- | Cytore.hpp | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -142,8 +142,11 @@ class File { bool Truncate_(size_t capacity) { capacity = Round(capacity, Block_); + int error(ftruncate(file_, capacity)); - _assert(error == 0); + if (error != 0) + return false; + Map_(capacity); return true; } |