[SSSD] [PATCH] TOOLS: add missing '\n' in debug messages

Lukas Slebodnik lslebodn at redhat.com
Thu Jan 22 13:58:26 UTC 2015


On (22/01/15 08:52), Roland Mainz wrote:
>
>
>----- Original Message -----
>> From: "Lukas Slebodnik" <lslebodn at redhat.com>
>> To: "Development of the System Security Services Daemon" <sssd-devel at lists.fedorahosted.org>
>> Sent: Thursday, January 22, 2015 2:31:13 PM
>> Subject: Re: [SSSD] [PATCH] TOOLS: add missing '\n' in debug messages
>> 
>> On (22/01/15 14:05), Pavel Reichl wrote:
>> >
>> >On 01/22/2015 01:27 PM, Pavel Reichl wrote:
>> >>Hello, please see this trivial patch. Thanks!
>> >>
>> >I found some more messages requiring fixing.
>> 
>> I found even more
>> 
>> --- a/src/providers/ldap/sdap_async.c
>> +++ b/src/providers/ldap/sdap_async.c
>> @@ -85,9 +85,9 @@ static void sdap_handle_release(struct sdap_handle *sh)
>>  
>>      DEBUG(SSSDBG_TRACE_INTERNAL,
>>            "Trace: sh[%p], connected[%d], ops[%p], ldap[%p], "
>> -              "destructor_lock[%d], release_memory[%d]\n",
>> -              sh, (int)sh->connected, sh->ops, sh->ldap,
>> -              (int)sh->destructor_lock, (int)sh->release_memory);
>> +          "destructor_lock[%d], release_memory[%d]\n",
>> +          sh, sh->connected, sh->ops, sh->ldap,
>> +          sh->destructor_lock, sh->release_memory);
>> 
>> 
>> It would not be so easy.
>
>1. Why did you remove the casts to |(int)| ? IMO the casts are wise in such cases because otherwise you always have to make sure the datatype used in the format string matches the datatype in the |struct| ... and experience tells me that people might change the datatype in the |struct| without crawling over all the code and check the format strings. Please keep the casts.

I'm sorry but you are missng context.

variable "sh" is pointer to the "struct sdap_handle"
which is defined as:

>struct sdap_handle {
>    #snip
>
>    /* during release we need to lock access to the handler
>     * from the destructor to avoid recursion */
>    bool destructor_lock;
>    /* mark when it is safe to finally release the handler memory */
>    bool release_memory;
>};

LS



More information about the sssd-devel mailing list