From bdd911158307280401d74a7805753c44d73028b4 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sat, 12 Feb 2011 21:26:08 -0800 Subject: [PATCH] Support ftruncate error conditions. --- Cytore.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Cytore.hpp b/Cytore.hpp index cb6c4241..168f2ef5 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; } -- 2.45.2