fchdir: avoid extra chdir and fix test
authorEric Blake <eblake@redhat.com>
Tue, 26 Apr 2011 21:58:03 +0000 (15:58 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 27 Apr 2011 21:01:05 +0000 (15:01 -0600)
commit825499de077435754651ff49b3f3dba576a2ebc6
tree0a932e60ddd0646e5377c752aee442316763953d
parent59680ace35de01c8c3df5299b78ab14f15e3712a
fchdir: avoid extra chdir and fix test

On Linux, with a forced ac_cv_func_fchdir=no, the test failed
because dup2 was not replaced, all because the shell variable
ac_cv_func_dup2 had not been set yet.

Meanwhile, computing the canonical pathname of a directory on
mingw was rather expensive -- multiple chdir()! -- but nothing
cared whether the name was canonical, just that it was absolute.

* modules/fchdir (Depends-on): Add dosname, filenamecat-lgpl,
getcwd-lgpl.
* lib/fchdir.c (get_name): Any absolute name will do; it does not
have to be canonical.
* m4/dup2.m4 (gl_REPLACE_DUP2): Ensure dup2 is replaced.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
lib/fchdir.c
m4/dup2.m4
modules/fchdir