Skip to content

Commit 9573d2b

Browse files
committed
Merge #19194: util: Don't reference errno when pthread fails.
cb38b06 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 cb38b06 -- patch looks correct MarcoFalke: review ACK cb38b06 hebasto: ACK cb38b06, only squashed commits since the [previous](bitcoin/bitcoin#19194 (review)) review. Tree-SHA512: e6c950e30726e5031db97a7b84c8a9215da5ad3e5d233bcc349f812ad15957ddfe378e26d18339b9e0a5dcac2f50b47a687b87a6a6beaf6139df84f31531321e
2 parents 41fb694 + cb38b06 commit 9573d2b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/util/system.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,8 +1163,9 @@ void ScheduleBatchPriority()
11631163
{
11641164
#ifdef SCHED_BATCH
11651165
const static sched_param param{};
1166-
if (pthread_setschedparam(pthread_self(), SCHED_BATCH, &param) != 0) {
1167-
LogPrintf("Failed to pthread_setschedparam: %s\n", strerror(errno));
1166+
const int rc = pthread_setschedparam(pthread_self(), SCHED_BATCH, &param);
1167+
if (rc != 0) {
1168+
LogPrintf("Failed to pthread_setschedparam: %s\n", strerror(rc));
11681169
}
11691170
#endif
11701171
}

0 commit comments

Comments
 (0)