linux: allow root user to raise priority
authorRainer Hochecker <fernetmenta@online.de>
Sun, 15 Dec 2013 17:44:40 +0000 (18:44 +0100)
committerRainer Hochecker <fernetmenta@online.de>
Sun, 15 Dec 2013 17:50:23 +0000 (18:50 +0100)
xbmc/threads/platform/pthreads/ThreadImpl.cpp

index 33e3997..70b6ac0 100644 (file)
@@ -97,6 +97,9 @@ void CThread::SetThreadInfo()
   else
     userMaxPrio = 0;
 
+  if (geteuid() == 0)
+    userMaxPrio = GetMaxPriority();
+
   // if the user does not have an entry in limits.conf the following
   // call will fail
   if (userMaxPrio > 0)
@@ -169,6 +172,9 @@ bool CThread::SetPriority(const int iPriority)
     else
       userMaxPrio = 0;
 
+    if (geteuid() == 0)
+      userMaxPrio = GetMaxPriority();
+
     // keep priority in bounds
     int prio = iPriority;
     if (prio >= GetMaxPriority())