[PATCH] realpath stack usage 8k -> 4k
Carmelo AMOROSO
carmelo.amoroso at st.com
Thu May 8 14:01:53 UTC 2008
Denys Vlasenko wrote:
> On Thursday 08 May 2008 11:12, Carmelo AMOROSO wrote:
>
>> Hi Denys,
>> I looked better at realpath man page and your implementation...
>> well I think that we should only fix the test not testing for buffer
>> contents (that in undefined)
>> when the realpath fails... so i'd use 'result' instead of test[i].out or
>> test[i].resolved...
>> something like that
>>
>> - if (!check_path (buf, tests[i].out ? tests[i].out : tests[i].resolved))
>> + if (result && !check_path (buf, tests[i].out ? tests[i].out : tests[i].resolved))
>> {
>> printf ("%s: flunked test %d (expected resolved `%s', got `%s')\n",
>> argv[0], i, tests[i].out ? tests[i].out : tests[i].resolved,
>>
>> So, if realpath return result==NULL (it means it is failing), then
>> do not check buffern content and go on to check the errno for ELOOP
>>
>> Do you agree ?
>>
>
> Yes.
>
> I committed the fix to svn.
>
you said yes... but committed something different, you did not use my
last suggestion
to use result
> I also renamed struct fields to more closely explain what they mean.
> Another change is to check errno always, regardless of NULL return.
> This last change found a bug in realpath - also fixed now.
> --
> vda
>
>
More information about the uClibc
mailing list