Merge bitcoin/bitcoin#29910: refactor: Rename subprocess.hpp to follow our header name conventions
08f756bd37Replace locale-dependent `std::strerror` with `SysErrorString` (Hennadii Stepanov)d8e4ba4d05refactor: Rename `subprocess.hpp` to follow our header name conventions (Hennadii Stepanov) Pull request description: This PR renames the header `*.hpp` --> `*.h` and adjusts the header guard name, which makes it available for processing by linters. Fixed the following linter warning: ``` The locale dependent function strerror(...) appears to be used: src/util/subprocess.h: std::runtime_error( err_msg + ": " + std::strerror(err_code) ) Unnecessary locale dependence can cause bugs that are very tricky to isolate and fix. Please avoid using locale-dependent functions if possible. Advice not applicable in this specific case? Add an exception by updating the ignore list in /bitcoin/test/lint/lint-locale-dependence.py ^---- failure generated from lint-locale-dependence.py ``` ACKs for top commit: TheCharlatan: ACK08f756bd37Tree-SHA512: 57a2f01c20eb9552481e428a4969bd59e9ada9f784fe1a45cb62aa9c9152c8e950d336854f45af0e2e5dc7c7b2a1fb216c8f832e3d6ccfb457ad71b6e423231e
This commit is contained in:
4 files changed
+9
-7
No files matched your search
+1
-1
@@ -320,7 +320,7 @@ BITCOIN_CORE_H = \
|
|||||||
util/sock.h \
|
util/sock.h \
|
||||||
util/spanparsing.h \
|
util/spanparsing.h \
|
||||||
util/string.h \
|
util/string.h \
|
||||||
util/subprocess.hpp \
|
util/subprocess.h \
|
||||||
util/syserror.h \
|
util/syserror.h \
|
||||||
util/task_runner.h \
|
util/task_runner.h \
|
||||||
util/thread.h \
|
util/thread.h \
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#include <univalue.h>
|
#include <univalue.h>
|
||||||
|
|
||||||
#ifdef ENABLE_EXTERNAL_SIGNER
|
#ifdef ENABLE_EXTERNAL_SIGNER
|
||||||
#include <util/subprocess.hpp>
|
#include <util/subprocess.h>
|
||||||
#endif // ENABLE_EXTERNAL_SIGNER
|
#endif // ENABLE_EXTERNAL_SIGNER
|
||||||
|
|
||||||
UniValue RunCommandParseJSON(const std::string& str_command, const std::string& str_std_in)
|
UniValue RunCommandParseJSON(const std::string& str_command, const std::string& str_std_in)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include <univalue.h>
|
#include <univalue.h>
|
||||||
|
|
||||||
#ifdef ENABLE_EXTERNAL_SIGNER
|
#ifdef ENABLE_EXTERNAL_SIGNER
|
||||||
#include <util/subprocess.hpp>
|
#include <util/subprocess.h>
|
||||||
#endif // ENABLE_EXTERNAL_SIGNER
|
#endif // ENABLE_EXTERNAL_SIGNER
|
||||||
|
|
||||||
#include <boost/test/unit_test.hpp>
|
#include <boost/test/unit_test.hpp>
|
||||||
|
|||||||
@@ -33,8 +33,10 @@ Documentation for C++ subprocessing library.
|
|||||||
@version 1.0.0
|
@version 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SUBPROCESS_HPP
|
#ifndef BITCOIN_UTIL_SUBPROCESS_H
|
||||||
#define SUBPROCESS_HPP
|
#define BITCOIN_UTIL_SUBPROCESS_H
|
||||||
|
|
||||||
|
#include <util/syserror.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
@@ -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))
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1609,4 +1611,4 @@ namespace detail {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // SUBPROCESS_HPP
|
#endif // BITCOIN_UTIL_SUBPROCESS_H
|
||||||
Reference in new issue
Block a user