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:
laanwj
2022-04-20 16:17:19 +02:00
parent 4381681e55
commit 46971c6dbf
8 changed files with 59 additions and 17 deletions

View File

@@ -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)