Mercurial > hg > octave-nkf > gnulib-hg
view modules/fchdir @ 12066:5e590c10bc80
fchdir: another mingw fix
canonicalize_file_name does not understand drive letters or
backslash. The only reason openat required it was to make
fchdir get the canonical name of a directory. But we can do
the same trick with chdir and getcwd. With this fix,
fchdir(open("..",O_RDONLY)) finally does the right thing on mingw.
* modules/fchdir (Depends-on): Drop canonicalize-lgpl.
* lib/fchdir.c (get_name): New helper method; skips canonicalize
on mingw (where it has not yet been ported), and make it optional
elsewhere.
(_gl_register_fd): Use it.
Signed-off-by: Eric Blake <ebb9@byu.net>
author | Eric Blake <ebb9@byu.net> |
---|---|
date | Wed, 23 Sep 2009 20:33:40 -0600 |
parents | ac2a6371d78c |
children | 2a3833485e1c |
line wrap: on
line source
Description: fchdir() function: change current directory, given an open file descriptor. Files: lib/fchdir.c m4/fchdir.m4 Depends-on: close dirent dirfd dup2 fcntl-h include_next malloc-posix open realloc-posix stat stdbool strdup-posix sys_stat unistd configure.ac: gl_FUNC_FCHDIR gl_UNISTD_MODULE_INDICATOR([fchdir]) Makefile.am: Include: <unistd.h> License: LGPL Maintainer: Bruno Haible