diff options
author | fanquake <fanquake@gmail.com> | 2020-06-08 19:35:57 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2020-06-08 19:36:28 +0800 |
commit | 9573d2b55b45b24b9920cf5983d1681205ff41df (patch) | |
tree | 78ad65758efb7ab9398d8e691b2433b8962426eb | |
parent | 41fb69404c037c0f70a57861adb60ff40b318a32 (diff) | |
parent | cb38b069b0f41b1a26264784b1c1303c8ac6ab08 (diff) |
Merge #19194: util: Don't reference errno when pthread fails.
cb38b069b0f41b1a26264784b1c1303c8ac6ab08 util: Don't reference errno when pthread fails. (MIZUTA Takeshi)
Pull request description:
Pthread library does not set errno.
Pthread library's errno is returned by return value.
ACKs for top commit:
practicalswift:
ACK cb38b069b0f41b1a26264784b1c1303c8ac6ab08 -- patch looks correct
MarcoFalke:
review ACK cb38b069b0f41b1a26264784b1c1303c8ac6ab08
hebasto:
ACK cb38b069b0f41b1a26264784b1c1303c8ac6ab08, only squashed commits since the [previous](https://github.com/bitcoin/bitcoin/pull/19194#pullrequestreview-425831739) review.
Tree-SHA512: e6c950e30726e5031db97a7b84c8a9215da5ad3e5d233bcc349f812ad15957ddfe378e26d18339b9e0a5dcac2f50b47a687b87a6a6beaf6139df84f31531321e
-rw-r--r-- | src/util/system.cpp | 5 |
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, ¶m) != 0) { - LogPrintf("Failed to pthread_setschedparam: %s\n", strerror(errno)); + const int rc = pthread_setschedparam(pthread_self(), SCHED_BATCH, ¶m); + if (rc != 0) { + LogPrintf("Failed to pthread_setschedparam: %s\n", strerror(rc)); } #endif } |