]> git.saurik.com Git - cydia.git/commitdiff
Support ftruncate error conditions.
authorJay Freeman (saurik) <saurik@saurik.com>
Sun, 13 Feb 2011 05:26:08 +0000 (21:26 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Sun, 13 Feb 2011 05:26:08 +0000 (21:26 -0800)
Cytore.hpp

index cb6c42415f2e261d264858e11c258a3211446d00..168f2ef574127f4090fbc5a45a8c136e86656849 100644 (file)
@@ -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;
     }