aboutsummaryrefslogtreecommitdiff
path: root/src/util/system.cpp
diff options
context:
space:
mode:
authorlaanwj <126646+laanwj@users.noreply.github.com>2022-04-20 16:17:19 +0200
committerlaanwj <126646+laanwj@users.noreply.github.com>2022-04-28 10:24:06 +0200
commit46971c6dbfbc39ebbc74ab1ed8c00edc12859373 (patch)
tree9b8e249e986116f4490cacf2e9c8439b2066b8a7 /src/util/system.cpp
parent4381681e554d9bf10ef1ac43cede9cfa10bfb439 (diff)
downloadbitcoin-46971c6dbfbc39ebbc74ab1ed8c00edc12859373.tar.xz
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/util/system.cpp')
-rw-r--r--src/util/system.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/util/system.cpp b/src/util/system.cpp
index f9a9ad3e20..6845e815ed 100644
--- a/src/util/system.cpp
+++ b/src/util/system.cpp
@@ -25,6 +25,7 @@
#include <util/getuniquepath.h>
#include <util/strencodings.h>
#include <util/string.h>
+#include <util/syserror.h>
#include <util/translation.h>
@@ -1374,7 +1375,7 @@ void ScheduleBatchPriority()
const static sched_param param{};
const int rc = pthread_setschedparam(pthread_self(), SCHED_BATCH, &param);
if (rc != 0) {
- LogPrintf("Failed to pthread_setschedparam: %s\n", strerror(rc));
+ LogPrintf("Failed to pthread_setschedparam: %s\n", SysErrorString(rc));
}
#endif
}