Message ID | 20090408154158.mbv7qx7cmcs8wg8w@sohoserver.homelinux.net |
---|---|
State | New |
Headers |
Received: from dd1030.kasserver.com ([85.13.128.18]) by mail.linuxtv.org with esmtp (Exim 4.63) (envelope-from <vdr@dachsweb.de>) id 1LrY30-0004sD-QP for vdr@linuxtv.org; Wed, 08 Apr 2009 15:42:35 +0200 Received: from e-pc.dachsweb.home (e177201119.adsl.alicedsl.de [85.177.201.119]) by dd1030.kasserver.com (Postfix) with ESMTP id 23381D6DDF82 for <vdr@linuxtv.org>; Wed, 8 Apr 2009 15:42:32 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by e-pc.dachsweb.home (Postfix) with ESMTP id 4B6811AE509 for <vdr@linuxtv.org>; Wed, 8 Apr 2009 15:42:30 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at dachsweb.home Received: from e-pc.dachsweb.home ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4kfpn-eAgk6e for <vdr@linuxtv.org>; Wed, 8 Apr 2009 15:41:59 +0200 (CEST) Received: by e-pc.dachsweb.home (Postfix, from userid 33) id 05F071AE507; Wed, 8 Apr 2009 15:41:58 +0200 (CEST) Received: from 217.5.231.249 ([217.5.231.249]) by sohoserver.homelinux.net (Horde MIME library) with HTTP; Wed, 08 Apr 2009 15:41:58 +0200 Message-ID: <20090408154158.mbv7qx7cmcs8wg8w@sohoserver.homelinux.net> Date: Wed, 08 Apr 2009 15:41:58 +0200 From: Gerald Dachs <vdr@dachsweb.de> To: vdr@linuxtv.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.1.4) X-LSpam-Score: -2.3 (--) X-LSpam-Report: No, score=-2.3 required=5.0 tests=AWL=0.298, BAYES_00=-2.599 autolearn=ham Subject: [vdr] ERROR (thread.c,225): Keine Berechtigung X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.9 Precedence: list Reply-To: VDR Mailing List <vdr@linuxtv.org> List-Id: VDR Mailing List <vdr.linuxtv.org> List-Unsubscribe: <http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr>, <mailto:vdr-request@linuxtv.org?subject=unsubscribe> List-Archive: <http://www.linuxtv.org/pipermail/vdr> List-Post: <mailto:vdr@linuxtv.org> List-Help: <mailto:vdr-request@linuxtv.org?subject=help> List-Subscribe: <http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr>, <mailto:vdr-request@linuxtv.org?subject=subscribe> X-List-Received-Date: Wed, 08 Apr 2009 13:42:35 -0000 Status: O X-Status: X-Keywords: X-UID: 19995 |
Commit Message
Gerald Dachs
April 8, 2009, 1:41 p.m. UTC
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? Gerald ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.
Comments
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
Am Fri, 10 Apr 2009 12:28:35 +0200 schrieb Udo Richter <udo_richter@gmx.de>: > 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. Oh yes, you are right, I didn't read the man page careful enough, sorry. getuid() makes only sense with PRIO_USER. Gerald
On Wed, 8 Apr 2009, 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? I've solved this by tweaking the capabilities. google: vdr-1.6.0-cap_sys_nice.patch BR, -- rofa
--- vdr-1.6.0/thread.c.orig 2009-04-08 15:33:52.000000000 +0200 +++ vdr-1.6.0/thread.c 2009-04-08 15:34:22.000000000 +0200 @@ -220,7 +220,7 @@ void cThread::SetPriority(int Priority) { - if (setpriority(PRIO_PROCESS, 0, Priority) < 0) + if (setpriority(PRIO_PROCESS, getuid(), Priority) < 0) LOG_ERROR; }