mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-03 20:35:17 +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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user