[Pdns-dev] Re: Bug in pdns_recursor (pdns 2.9.9)

Christof Meerwald cmeerw at web.de
Mon Jun 23 22:43:10 CEST 2003


On Mon, 23 Jun 2003 21:21:54 +0200, Norbert Sendetzky wrote:
>> On Mon, 23 Jun 2003 00:00:04 +0200, bert hubert wrote:
>>> On Sun, Jun 22, 2003 at 11:11:30PM +0200, Christof Meerwald wrote:
>>>> pdns/pdns_recursor.cc (line 47)
>>>>   pthread_t pthread_self(void){pthread_t tmp; return tmp;}
>>>> returning an uninitialized local variable is a very bad idea (and results 
>> in
>>>> empty lines being written to syslog).
>>> This function is never called - it is only a bogus function to satisfy an
>>> unused dependency. If it is ever called, it is a problem.
>> At least pdns/logger.cc calls pthread_self (and pdns_recursor.cc uses the
>> Logger).
> Well, Logger will call the real pthread_self() function and not the dummy (I 
> hope).

There is no other (or real) pthread_self function - pdns_recursor doesn't
link with -lpthread. And even if it would, I think it would still call the
locally overridden pthread_self.


> To remove the warning, simply change the line to:
> pthread_t pthread_self(void){return (pthread_t) 0;}

I know, but it's not portable - I don't know that pthread_t really is an
integer, it could also be a struct.


bye, Christof

-- 
http://cmeerw.org                                 JID: cmeerw at jabber.at
mailto cmeerw at web.de


More information about the Pdns-dev mailing list