diff options
-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 */ |