diff options
author | Joel Rosdahl <joel@rosdahl.net> | 2020-05-16 16:17:44 +0200 |
---|---|---|
committer | Joel Rosdahl <joel@rosdahl.net> | 2020-05-20 20:07:12 +0200 |
commit | 26fd7eab265e5d53082403e28949e7c6b45995b9 (patch) | |
tree | 41713a774026e891e30d804ecf079410428395f7 /src/AtomicFile.cpp | |
parent | 97375305e97d5b50e6178347a029947b3ce320b4 (diff) | |
download | ccache-26fd7eab265e5d53082403e28949e7c6b45995b9.tar.gz |
C++-ify unlink wrapper functions
x_unlink(p) == 0 -> Util::unlink_safe(p)
x_try_unlink == 0 -> Util::unlink_safe(p, Util::UnlinkLog::ignore_failure)
tmp_unlink(p) == 0 -> Util::unlink_tmp(p)
Diffstat (limited to 'src/AtomicFile.cpp')
-rw-r--r-- | src/AtomicFile.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/AtomicFile.cpp b/src/AtomicFile.cpp index 4dbc805c..0cb6cc21 100644 --- a/src/AtomicFile.cpp +++ b/src/AtomicFile.cpp @@ -39,7 +39,7 @@ AtomicFile::~AtomicFile() if (m_stream) { // commit() was not called so remove the lingering temporary file. fclose(m_stream); - tmp_unlink(m_tmp_path.c_str()); + Util::unlink_tmp(m_tmp_path); } } @@ -68,7 +68,7 @@ AtomicFile::commit() int result = fclose(m_stream); m_stream = nullptr; if (result == EOF) { - tmp_unlink(m_tmp_path.c_str()); + Util::unlink_tmp(m_tmp_path); throw Error( fmt::format("failed to write data to {}: {}", m_path, strerror(errno))); } |