summaryrefslogtreecommitdiff
path: root/src/utils/cpp/file_locking.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/cpp/file_locking.cpp')
-rw-r--r--src/utils/cpp/file_locking.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/utils/cpp/file_locking.cpp b/src/utils/cpp/file_locking.cpp
index d7f0c49a..53cba2bf 100644
--- a/src/utils/cpp/file_locking.cpp
+++ b/src/utils/cpp/file_locking.cpp
@@ -14,7 +14,8 @@
#include "src/utils/cpp/file_locking.hpp"
-#include <cerrno> // for errno
+#include <cerrno> // for errno
+#include <cstring> // for strerror()
#ifdef __unix__
#include <sys/file.h>
@@ -56,11 +57,10 @@ auto LockFile::Acquire(std::filesystem::path const& fspath,
// attach flock
auto err = flock(fileno(file_handle), is_shared ? LOCK_SH : LOCK_EX);
if (err != 0) {
- Logger::Log(
- LogLevel::Error,
- "LockFile: applying lock to file {} failed with errno {}",
- lock_file->string(),
- errno);
+ Logger::Log(LogLevel::Error,
+ "LockFile: applying lock to file {} failed with:\n{}",
+ lock_file->string(),
+ strerror(errno));
fclose(file_handle);
return std::nullopt;
}