Re: ERROR (thread.c,225): Keine Berechtigung

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08.04.2009 15:41, Gerald Dachs wrote:
> On every start of the vdr I get this error message:
>    Apr 2 00:33:36 vdr vdr: [2462] ERROR (thread.c,225): Keine Berechtigung
> It comes from cThread::SetPriority and seems to be harmless, but annoying.
> Is the attached patch the right cure?
>
>    void cThread::SetPriority(int Priority)
>    {
> -  if (setpriority(PRIO_PROCESS, 0, Priority)<  0)
> +  if (setpriority(PRIO_PROCESS, getuid(), Priority)<  0)
>         LOG_ERROR;
>    }

This is definitely wrong. setpriority expects a process ID together with 
PRIO_PROCESS, not an user ID. You could try to use getpid() instead. 
However, passing 0 as second parameter is officially allowed and is 
interpreted as the current process too.

The cause is more likely that the process is not allowed to set the 
requested priority. To investigate this, you can dump the old and new 
priority value to the log files. Looks something like this: (untested)

dsyslog("%s thread setpriority %i to %i", Thread->description, 
getpriority(PRIO_PROCESS, 0), Priority);


Cheers,

Udo

_______________________________________________
vdr mailing list
vdr@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux