From 44c972226dd9bd147277dfce3b7b18b64a62d7b1 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 6 Dec 2006 04:04:22 +0000 Subject: [PATCH] Port to Tandem NSK/OSS, which lacks fchdir. Problem reported by Matthew Woehlke in . * bootstrap.conf (gnulib_modules): Remove openat, as it pulls in fchdir. * configure.ac: Check for fdopendir. * gzip.c: Don't include openat.h; no longer needed. (treat_dir) [!HAVE_FDOPENDIR]: Fall back on the old opendir method since fdopendir is not available. --- ChangeLog | 12 ++++++++++++ bootstrap.conf | 1 - configure.ac | 2 +- gzip.c | 8 +++++++- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index cde2dc5..9f580b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2006-12-05 Paul Eggert + + Port to Tandem NSK/OSS, which lacks fchdir. Problem reported by + Matthew Woehlke in + . + * bootstrap.conf (gnulib_modules): Remove openat, as it pulls in + fchdir. + * configure.ac: Check for fdopendir. + * gzip.c: Don't include openat.h; no longer needed. + (treat_dir) [!HAVE_FDOPENDIR]: Fall back on the old opendir method + since fdopendir is not available. + 2006-12-04 Paul Eggert * NEWS: Describe the following change briefly. diff --git a/bootstrap.conf b/bootstrap.conf index 45ceb0b..39420d1 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -23,7 +23,6 @@ IMPORT_FROM_GETTEXT=no # gnulib modules used by this package. gnulib_modules=' - openat fcntl fcntl-safer fdl diff --git a/configure.ac b/configure.ac index 2bc25a4..2b7e634 100644 --- a/configure.ac +++ b/configure.ac @@ -79,7 +79,7 @@ AC_ISC_POSIX AC_C_CONST AC_HEADER_STDC AC_CHECK_HEADERS_ONCE(fcntl.h limits.h memory.h time.h) -AC_CHECK_FUNCS_ONCE([fchmod fchown lstat]) +AC_CHECK_FUNCS_ONCE([fchmod fchown fdopendir lstat]) AC_HEADER_DIRENT AC_TYPE_SIGNAL AC_TYPE_SIZE_T diff --git a/gzip.c b/gzip.c index f732278..976955e 100644 --- a/gzip.c +++ b/gzip.c @@ -71,7 +71,6 @@ static char rcsid[] = "$Id$"; #include "fcntl-safer.h" #include "getopt.h" -#include "openat.h" #include "stat-time.h" /* configuration */ @@ -1759,11 +1758,18 @@ local void treat_dir (fd, dir) char nbuf[MAX_PATH_LEN]; int len; +#if HAVE_FDOPENDIR dirp = fdopendir (fd); +#else + close (fd); + dirp = opendir(dir); +#endif if (dirp == NULL) { progerror(dir); +#if HAVE_FDOPENDIR close (fd); +#endif return ; } /* -- 2.47.2