aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorMIZUTA Takeshi <mizuta.takeshi@fujitsu.com>2020-06-08 16:37:59 +0900
committerfanquake <fanquake@gmail.com>2020-06-09 21:06:15 +0800
commit0596a6eeb5ddb84c7095aed71bb7e6645c275f07 (patch)
treeaa312ce08c2e9b2fc30c0d11b3d8694e1c871cb5 /src/util
parentcd32134bda3e4bf04e58dd7555ef8b9d4bf1175b (diff)
downloadbitcoin-0596a6eeb5ddb84c7095aed71bb7e6645c275f07.tar.xz
util: Don't reference errno when pthread fails.
Pthread library does not set errno. Pthread library's errno is returned by return value. Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Github-Pull: #19194 Rebased-From: cb38b069b0f41b1a26264784b1c1303c8ac6ab08
Diffstat (limited to 'src/util')
-rw-r--r--src/util/system.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/util/system.cpp b/src/util/system.cpp
index b0a538b527..b6a7f3926d 100644
--- a/src/util/system.cpp
+++ b/src/util/system.cpp
@@ -1155,8 +1155,9 @@ void ScheduleBatchPriority()
{
#ifdef SCHED_BATCH
const static sched_param param{};
- if (pthread_setschedparam(pthread_self(), SCHED_BATCH, &param) != 0) {
- LogPrintf("Failed to pthread_setschedparam: %s\n", strerror(errno));
+ const int rc = pthread_setschedparam(pthread_self(), SCHED_BATCH, &param);
+ if (rc != 0) {
+ LogPrintf("Failed to pthread_setschedparam: %s\n", strerror(rc));
}
#endif
}