Eric Blake wrote:
> On 01/11/2011 12:08 PM, Paul Eggert wrote:
>> On 01/11/11 11:03, Eric Blake wrote:
>>> But you should still drop the xmalloc dependency from the module
>>> description.
>>
>> Hmm, sorry, I guess I should have mentioned that I looked for that,
>> and couldn't find the dependency. The only modules that mention
>> lib/openat-proc.c are fdopendir and openat, and neither module
>> depends on xmalloc. I think this is a dependency bug, and that
>> my proposed patch fixes it by removing the need for the dependency.
>
> Hmm, it's an indirect dependency, but it's definitely being pulled in:
>
> $ ./gnulib-tool --with-tests --test openat
> Module list with included dependencies (indented):
...
> xgetcwd
>
> I'll try looking deeper to see where the real culprit lies, and if we
> can break the rest of this module chain from dragging in xalloc.
save-cwd uses xgetcwd, which calls xalloc_die.
/* Return the current directory, newly allocated.
Upon an out-of-memory error, call xalloc_die.
Upon any other type of error, return NULL. */
char *
xgetcwd (void)
{
char *cwd = getcwd (NULL, 0);
if (! cwd && errno == ENOMEM)
xalloc_die ();
return cwd;
}