Port to Tandem NSK/OSS, which lacks fchdir. Problem reported by
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 6 Dec 2006 04:04:22 +0000 (04:04 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 6 Dec 2006 04:04:22 +0000 (04:04 +0000)
Matthew Woehlke in
<http://lists.gnu.org/archive/html/bug-gzip/2006-11/msg00013.html>.
* 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
bootstrap.conf
configure.ac
gzip.c

index cde2dc58e9cc9b752b284d8273991f1ad0c8d007..9f580b7ba5a66d126563f2baf74b09baeb153573 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2006-12-05  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Port to Tandem NSK/OSS, which lacks fchdir.  Problem reported by
+       Matthew Woehlke in
+       <http://lists.gnu.org/archive/html/bug-gzip/2006-11/msg00013.html>.
+       * 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  <eggert@cs.ucla.edu>
 
        * NEWS: Describe the following change briefly.
index 45ceb0b060dcc0aa5ad4a05b1a603d7f29f5c4d1..39420d163d321a08e895249cf7ef027d5b33acef 100644 (file)
@@ -23,7 +23,6 @@ IMPORT_FROM_GETTEXT=no
 
 # gnulib modules used by this package.
 gnulib_modules='
-       openat
        fcntl
        fcntl-safer
        fdl
index 2bc25a45987abfeeb9d6ad9bf75fabfa7a9babaf..2b7e6344d95059be0c6eec799309849608282c60 100644 (file)
@@ -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 f732278f082f52acb0ed08c70b9d36ebf198a3f1..976955efe0f24273bb97d8c310840aeb899416d1 100644 (file)
--- 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 ;
     }
     /*