[EMAIL PROTECTED] (Bob Proulx) wrote:
> Done. It "works".
Thanks for the quick test.
>> I expect it to abort and leave behind the deep tree.
>> If that's what it does, then I'll change all exit calls to
>> always exit 0, and just let the abort trigger the test failure.
>
> Nope. Sitting in /tmp/rwp I run the program and the desired_depth is
> computed to be 1091.
>
>> initial_cwd_len = strlen (cwd);
>> desired_depth = ((buf_len - 1 - initial_cwd_len) / (1 + strlen
>> (dir_name)));
>
> (gdb) p initial_cwd_len
> $4 = 8
> (gdb) p desired_depth
> $5 = 1091
>
>> for (d = 0; d < desired_depth; d++)
>> {
>> if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0)
>> {
>> fail = 3; /* Unable to construct deep hierarchy. */
>> break;
>> }
>> }
>>
>> cwd = getcwd (buf, buf_len);
>
> (gdb) p cwd
> $6 = 0x6000000000004010
> "/tmp/rwp/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B"...
>
> (gdb) p d
> $7 = 1091
I should have created a directory whose abs. name length
is a little *larger* than 16K, not just smaller.
Does it provoke the failed assertion if you change this line
size_t buf_len = 16 * 1024;
to e.g., this:
size_t buf_len = 20 * 1024;
_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils