bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] test-getcwd: don't stack-allocate PATH_MAX bytes


From: Eric Blake
Subject: Re: [PATCH] test-getcwd: don't stack-allocate PATH_MAX bytes
Date: Mon, 20 Jun 2011 16:59:04 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10

On 06/20/2011 04:43 PM, Bruno Haible wrote:
> Eric Blake wrote:
>> --- a/tests/test-getcwd.c
>> +++ b/tests/test-getcwd.c
>> @@ -26,7 +26,6 @@
>>  #include <string.h>
>>  #include <sys/stat.h>
>>
>> -#include "pathmax.h"
>>  #include "macros.h"
>>
>>  #if ! HAVE_GETPAGESIZE
>>
> 
> Hmm, this will now cause test_long_name to return immediately on HP-UX, 
> without
> performing a test. Is this intended? For GNU/Hurd it is intended, but for 
> HP-UX
> we know the right value is 1024, and "pathmax.h" defines it.

Well, if we go with your patch to fix "pathmax.h" to define PATH_MAX on
HP-UX but leave it undefined on Hurd, then test-getcwd should go back to
using pathmax.h, but still use my fixes to avoid the stack allocation.
That is, somewhat of a middle ground between the two extremes (my worry
was that "pathmax.h" was always defining a value, even on Hurd, whereas
your worry is that on HP-UX we still want to test the case of a file
name larger than PATH_MAX but smaller than page size).

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]