diff options
author | laanwj <126646+laanwj@users.noreply.github.com> | 2022-04-20 16:17:19 +0200 |
---|---|---|
committer | laanwj <126646+laanwj@users.noreply.github.com> | 2022-04-28 10:24:06 +0200 |
commit | 46971c6dbfbc39ebbc74ab1ed8c00edc12859373 (patch) | |
tree | 9b8e249e986116f4490cacf2e9c8439b2066b8a7 /src/bitcoind.cpp | |
parent | 4381681e554d9bf10ef1ac43cede9cfa10bfb439 (diff) |
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/bitcoind.cpp')
-rw-r--r-- | src/bitcoind.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 9843382682..bc063faed1 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -20,6 +20,7 @@ #include <util/check.h> #include <util/strencodings.h> #include <util/syscall_sandbox.h> +#include <util/syserror.h> #include <util/system.h> #include <util/threadnames.h> #include <util/tokenpipe.h> @@ -206,7 +207,7 @@ static bool AppInit(NodeContext& node, int argc, char* argv[]) } break; case -1: // Error happened. - return InitError(Untranslated(strprintf("fork_daemon() failed: %s\n", strerror(errno)))); + return InitError(Untranslated(strprintf("fork_daemon() failed: %s\n", SysErrorString(errno)))); default: { // Parent: wait and exit. int token = daemon_ep.TokenRead(); if (token) { // Success |