aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-08-04 12:46:27 -0700
committerChris Robinson <[email protected]>2020-08-04 12:46:27 -0700
commit2e1645f32af9f858a580f25d26bffa31c7b877fb (patch)
treeb713528059cbfbc01438113fa4acacc5fdc581f6
parent7cac5304c8e4a70ac0188693dbcb6eaf46b7601f (diff)
Print the error from pthread_setschedparam
-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 */