diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2017-01-29 07:32:55 -0800 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2017-01-29 07:32:55 -0800 |
commit | 7a6e17cff79a3a007a2519bdb676f1be8e937624 (patch) | |
tree | c9c7ee055334d10d2b4e095f7015c6a31153d22a | |
parent | 1fe922cd8b76cffdb15eac07f6e686449e1b1469 (diff) |
If Cytore fails to allocate an empty file, unlink.
-rw-r--r-- | Cytore.hpp | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -190,7 +190,11 @@ class File { size_t size(stat.st_size); if (size == 0) { - _assert(Truncate_(core)); + if (!Truncate_(core)) { + unlink(path); + _assert(false); + } + Header_().magic_ = Magic; Size_() = core; } else { |