aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMIZUTA Takeshi <mizuta.takeshi@fujitsu.com>2020-06-08 16:37:59 +0900
committerMIZUTA Takeshi <mizuta.takeshi@fujitsu.com>2020-06-08 16:37:59 +0900
commitcb38b069b0f41b1a26264784b1c1303c8ac6ab08 (patch)
tree5646c0e64c39ccd73c6468bf45cd3c985ac83c37 /src
parentb1b173994406158e5faa3c83b113da9d971ac104 (diff)
downloadbitcoin-cb38b069b0f41b1a26264784b1c1303c8ac6ab08.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>
Diffstat (limited to 'src')
-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 bde0f097be..7e7ba840cd 100644
--- a/src/util/system.cpp
+++ b/src/util/system.cpp
@@ -1163,8 +1163,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
}