diff options
author | Chris Robinson <[email protected]> | 2020-08-04 12:46:27 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-08-04 12:46:27 -0700 |
commit | 2e1645f32af9f858a580f25d26bffa31c7b877fb (patch) | |
tree | b713528059cbfbc01438113fa4acacc5fdc581f6 | |
parent | 7cac5304c8e4a70ac0188693dbcb6eaf46b7601f (diff) |
Print the error from pthread_setschedparam
-rw-r--r-- | alc/helpers.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/alc/helpers.cpp b/alc/helpers.cpp index cd1d6498..2b262b65 100644 --- a/alc/helpers.cpp +++ b/alc/helpers.cpp @@ -453,13 +453,14 @@ void SetRTPriority() * should be 1 for SCHED_RR). */ param.sched_priority = sched_get_priority_min(SCHED_RR); + int err; #ifdef SCHED_RESET_ON_FORK - if(pthread_setschedparam(pthread_self(), SCHED_RR|SCHED_RESET_ON_FORK, ¶m)) + err = pthread_setschedparam(pthread_self(), SCHED_RR|SCHED_RESET_ON_FORK, ¶m); + if(err == EINVAL) #endif - { - if(pthread_setschedparam(pthread_self(), SCHED_RR, ¶m)) - ERR("Failed to set real-time priority for thread\n"); - } + err = pthread_setschedparam(pthread_self(), SCHED_RR, ¶m); + if(err != 0) + ERR("Failed to set real-time priority for thread: %s (%d)\n", std::strerror(err), err); } #else /* Real-time priority not available */ |