From: Jay Freeman (saurik) Date: Sun, 13 Feb 2011 05:26:08 +0000 (-0800) Subject: Support ftruncate error conditions. X-Git-Tag: v1.1.0%b1~353 X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/625aabedd04172aa57b9903ff328375c4c9fa828 Support ftruncate error conditions. --- 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; }