aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--alc/helpers.cpp11
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, &param))
+ err = pthread_setschedparam(pthread_self(), SCHED_RR|SCHED_RESET_ON_FORK, &param);
+ if(err == EINVAL)
#endif
- {
- if(pthread_setschedparam(pthread_self(), SCHED_RR, &param))
- ERR("Failed to set real-time priority for thread\n");
- }
+ err = pthread_setschedparam(pthread_self(), SCHED_RR, &param);
+ 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 */