Paul Eggert wrote: > On 01/11/11 12:16, Jim Meyering wrote: >> save-cwd uses xgetcwd, which calls xalloc_die. > > Thanks for tracking that down. How about this revised patch > instead? It also fixes the ChangeLog along the lines of your > previous email. > >>From 47ea09cc55b49fa027b7f66e15cb5e70e7119ee6 Mon Sep 17 00:00:00 2001 > From: Paul Eggert <egg...@cs.ucla.edu> > Date: Tue, 11 Jan 2011 10:42:55 -0800 > Subject: [PATCH] openat, save-cwd: avoid xmalloc > > This removes an direct (but undocumented) dependency of openat on
nit: s/an/a/ That looks fine. Thanks! > xalloc, along with an indirect dependency via save-cwd. It also > removes a dependency of save-cwd on xgetcwd (and thereby > indirectly) on xalloc. This change causes the openat substitute > to fall back on save_cwd when memory is tight, and for save_cwd to > fail instead of dying when memory is tight, but that's good enough. > > * lib/openat-proc.c: Include stdlib.h (for malloc), not > xalloc.h (for xmalloc). > (openat_proc_name): Check for malloc failure. > * lib/save-cwd.c (save_cwd): Use getcwd, not xgetcwd. > * modules/save-cwd (Files): Remove xgetcwd.