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: cb38b069b0
This commit is contained in:
MIZUTA Takeshi 2020-06-08 16:37:59 +09:00 committed by fanquake
parent cd32134bda
commit 0596a6eeb5
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1

View file

@ -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
}