mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-22 20:58:09 +02:00
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.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user