summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-02-12 21:26:08 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2011-02-12 21:26:08 -0800
commit625aabedd04172aa57b9903ff328375c4c9fa828 (patch)
tree62bbbc4185d7dfae45d4a3bb756e0d18ab2b64dc
parent2530ab22f56855b2f137c65cf454311fc9824c77 (diff)
Support ftruncate error conditions.
-rw-r--r--Cytore.hpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Cytore.hpp b/Cytore.hpp
index cb6c424..168f2ef 100644
--- a/Cytore.hpp
+++ b/Cytore.hpp
@@ -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;
}