aboutsummaryrefslogtreecommitdiff
path: root/src/fs.cpp
diff options
context:
space:
mode:
authorlaanwj <126646+laanwj@users.noreply.github.com>2022-04-20 16:17:19 +0200
committerlaanwj <126646+laanwj@users.noreply.github.com>2022-04-28 10:24:06 +0200
commit46971c6dbfbc39ebbc74ab1ed8c00edc12859373 (patch)
tree9b8e249e986116f4490cacf2e9c8439b2066b8a7 /src/fs.cpp
parent4381681e554d9bf10ef1ac43cede9cfa10bfb439 (diff)
downloadbitcoin-46971c6dbfbc39ebbc74ab1ed8c00edc12859373.tar.xz
util: Replace non-threadsafe strerror
Some uses of non-threadsafe `strerror` have snuck into the code since they were removed in #4152. Add a wrapper `SysErrorString` for thread-safe strerror alternatives and replace all uses of `strerror` with this.
Diffstat (limited to 'src/fs.cpp')
-rw-r--r--src/fs.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/fs.cpp b/src/fs.cpp
index 219fdee959..b61115bf01 100644
--- a/src/fs.cpp
+++ b/src/fs.cpp
@@ -3,6 +3,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <fs.h>
+#include <util/syserror.h>
#ifndef WIN32
#include <cstring>
@@ -44,7 +45,7 @@ fs::path AbsPathJoin(const fs::path& base, const fs::path& path)
static std::string GetErrorReason()
{
- return std::strerror(errno);
+ return SysErrorString(errno);
}
FileLock::FileLock(const fs::path& file)