[PATCH] nss_files: Use struct scratch_buffer for gethostbyname [BZ #18023]
Adhemerval Zanella
adhemerval.zanella@linaro.org
Wed Oct 11 12:18:00 GMT 2017
On 11/10/2017 02:04, Florian Weimer wrote:
> On 10/10/2017 03:01 PM, Florian Weimer wrote:
>> On 09/05/2017 08:38 PM, Florian Weimer wrote:
>>
>>>> I do think this it is easier to read and follow the code *without* the goto,
>>>> something like:
>>>>
>>>> scratch_buffer_init (...);
>>>> while (1)
>>>> Â Â {
>>>> Â Â Â Â while ((status = internal_getent (...)) == NSS_STATUS_SUCCESS)
>>>> Â Â Â Â Â Â {
>>>> Â Â Â Â Â Â Â Â ...
>>>> Â Â Â Â Â Â }
>>>> Â Â Â Â if (status == NSS_STATUS_TRYAGAIN)
>>>> Â Â Â Â Â Â if (!scratch_buffer_grow (&tmp_buffer))
>>>> Â Â Â Â Â Â Â Â {
>>>> Â Â Â Â Â Â Â Â Â Â *herrnop = NETDB_INTERNAL;
>>>> Â Â Â Â Â Â Â Â Â Â status = NSS_STATUS_TRYAGAIN;
>>>> Â Â Â Â Â Â Â Â Â Â break;
>>>> Â Â Â Â Â Â Â Â }
>>>> Â Â Â Â else
>>>> Â Â Â Â Â Â status = NSS_STATUS_SUCCESS;
>>>> Â Â }
>>>> scratch_buffer_free (...);
>>>
>>> Right, I think I'll make this change in the first (refactoring) patch.
>>
>> I made this change in this patch instead. Still okay?
>
> I'm going to push this because you've already acked the subsequent patch.
LGTM, I though I had acked this patch as well (I did spend some time yesterday
checking the new version).
More information about the Libc-alpha
mailing list