From: Joel Rosdahl Date: Sun, 4 Feb 2024 14:33:51 +0000 (+0100) Subject: fix: Don't crash on full disk when recompressing the cache X-Git-Tag: v4.10~108 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39f48168addda0d14256e5b117d502e8feff78cd;p=thirdparty%2Fccache.git fix: Don't crash on full disk when recompressing the cache --- diff --git a/src/core/AtomicFile.cpp b/src/core/AtomicFile.cpp index a709a75ac..9efffa9a2 100644 --- a/src/core/AtomicFile.cpp +++ b/src/core/AtomicFile.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 Joel Rosdahl and other contributors +// Copyright (C) 2019-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -32,7 +32,7 @@ namespace core { AtomicFile::AtomicFile(const fs::path& path, Mode mode) : m_path(path) { auto tmp_file = - util::value_or_throw(util::TemporaryFile::create(path)); + util::value_or_throw(util::TemporaryFile::create(path)); m_stream = fdopen(tmp_file.fd.release(), mode == Mode::binary ? "w+b" : "w+"); m_tmp_path = std::move(tmp_file.path); }