openat, save-cwd: avoid xmalloc
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 11 Jan 2011 18:42:55 +0000 (10:42 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 11 Jan 2011 20:56:56 +0000 (12:56 -0800)
commit2392b18099a64ffb7aa2cf4fa3c81da96d2a5fc1
tree888bf14e36a371ee3820d0170815f0982c025009
parent03dd3ccd9a02d8406571243b74c6afb08f90ba2b
openat, save-cwd: avoid xmalloc

This removes a direct (but undocumented) dependency of openat on
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): Use malloc, not xmalloc.
* lib/save-cwd.c (save_cwd): Use getcwd, not xgetcwd.
* modules/save-cwd (Files): Depend on getcwd, not xgetcwd.
ChangeLog
lib/openat-proc.c
lib/save-cwd.c
modules/save-cwd