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>
This commit is contained in:
parent
b1b1739944
commit
cb38b069b0
1 changed files with 3 additions and 2 deletions
|
@ -1163,8 +1163,9 @@ void ScheduleBatchPriority()
|
||||||
{
|
{
|
||||||
#ifdef SCHED_BATCH
|
#ifdef SCHED_BATCH
|
||||||
const static sched_param param{};
|
const static sched_param param{};
|
||||||
if (pthread_setschedparam(pthread_self(), SCHED_BATCH, ¶m) != 0) {
|
const int rc = pthread_setschedparam(pthread_self(), SCHED_BATCH, ¶m);
|
||||||
LogPrintf("Failed to pthread_setschedparam: %s\n", strerror(errno));
|
if (rc != 0) {
|
||||||
|
LogPrintf("Failed to pthread_setschedparam: %s\n", strerror(rc));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue