Replace locale-dependent std::strerror with SysErrorString

This commit is contained in:
Hennadii Stepanov
2024-04-19 11:19:45 +01:00
parent d8e4ba4d05
commit 08f756bd37

View File

@@ -36,6 +36,8 @@ Documentation for C++ subprocessing library.
#ifndef BITCOIN_UTIL_SUBPROCESS_H #ifndef BITCOIN_UTIL_SUBPROCESS_H
#define BITCOIN_UTIL_SUBPROCESS_H #define BITCOIN_UTIL_SUBPROCESS_H
#include <util/syserror.h>
#include <algorithm> #include <algorithm>
#include <cassert> #include <cassert>
#include <csignal> #include <csignal>
@@ -150,7 +152,7 @@ class OSError: public std::runtime_error
{ {
public: public:
OSError(const std::string& err_msg, int err_code): OSError(const std::string& err_msg, int err_code):
std::runtime_error( err_msg + ": " + std::strerror(err_code) ) std::runtime_error(err_msg + ": " + SysErrorString(err_code))
{} {}
}; };