build: use gnulib's fdopendir module
authorJim Meyering <meyering@redhat.com>
Thu, 19 Nov 2009 12:59:11 +0000 (13:59 +0100)
committerJim Meyering <meyering@redhat.com>
Fri, 20 Nov 2009 16:32:00 +0000 (17:32 +0100)
* bootstrap.conf (gnulib_modules): Add fdopendir.
* gzip.c (treat_dir): Don't depend on HAVE_FDOPENDIR.
Gnulib now guarantees its availability.
* configure.ac: Don't check for fdopendir here.

Makefile.am
bootstrap.conf
configure.ac
gzip.c
lib/.gitignore
m4/.gitignore

index 406e344c43f179a9b7a5bfd82e4f0c49e76035c7..cfde8e0ddbe77ef6c8307d0330e6a50ab285f157 100644 (file)
@@ -19,7 +19,7 @@
 SUBDIRS = lib doc
 ACLOCAL_AMFLAGS = -I m4
 AM_CPPFLAGS = -I$(top_srcdir)/lib
-AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
+AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
 
 man_MANS = gunzip.1 gzexe.1 gzip.1 \
   zcat.1 zcmp.1 zdiff.1 zforce.1 zgrep.1 zless.1 zmore.1 znew.1
index 913deab1462fb740706e145707a55c7df159e7a3..f0afe13bbf1f12ab6eae917b42239e735de8b8bd 100644 (file)
@@ -29,14 +29,15 @@ fclose
 fcntl
 fcntl-safer
 fdl
+fdopendir
 fprintf-posix
 getopt-gnu
 git-version-gen
 gitlog-to-changelog
 gnu-make
 gnu-web-doc-update
-gnupload
 gnumakefile
+gnupload
 lstat
 maintainer-makefile
 malloc
index 7ae986324aa53171ffd0937bd1db5afcfa5df319..d87c5f3901149daa1f81fea5ea724496ff971723 100644 (file)
@@ -187,7 +187,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([chown fchmod fchown fdopendir lstat siginterrupt])
+AC_CHECK_FUNCS_ONCE([chown fchmod fchown lstat siginterrupt])
 AC_HEADER_DIRENT
 AC_TYPE_SIGNAL
 AC_TYPE_SIZE_T
diff --git a/gzip.c b/gzip.c
index b0f792a876ce1e3a8362b6e2ddd7042cab7e4d8b..ec3c585f04101026d3b60542a1cd99bed6a2f707 100644 (file)
--- a/gzip.c
+++ b/gzip.c
@@ -1717,18 +1717,11 @@ 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 ;
     }
     /*
index 5dc27b652f83fe2283225bb1d1173b85ed725a4d..e7eba30fb7bca39fcd00728aed7cfc6630c5f6d7 100644 (file)
@@ -4,8 +4,13 @@ Makefile.in
 alloca.h
 alloca.in.h
 asnprintf.c
+at-func.c
+basename-lgpl.c
 calloc.c
 charset.alias
+chdir-long.c
+chdir-long.h
+chown.c
 close-hook.c
 close-hook.h
 close-stream.c
@@ -20,6 +25,11 @@ config.h
 config.hin
 configmake.h
 creat-safer.c
+dirent.h
+dirent.in.h
+dirfd.c
+dirname-lgpl.c
+dirname.h
 dup-safer.c
 dup2.c
 errno.h
@@ -28,6 +38,10 @@ error.c
 error.h
 exitfail.c
 exitfail.h
+fchdir.c
+fchmodat.c
+fchown-stub.c
+fchownat.c
 fclose.c
 fcntl--.h
 fcntl-safer.h
@@ -35,6 +49,7 @@ fcntl.h
 fcntl.in.h
 fcntl_.h
 fd-safer.c
+fdopendir.c
 fflush.c
 float+.h
 float.h
@@ -54,7 +69,9 @@ frexpl.c
 fseeko.c
 fseterr.c
 fseterr.h
+fstatat.c
 ftello.c
+getcwd.c
 getopt.c
 getopt.h
 getopt.in.h
@@ -73,6 +90,7 @@ isnanf-nolibm.h
 isnanf.c
 isnanl-nolibm.h
 isnanl.c
+lchown.c
 libgzip.a
 localcharset.c
 localcharset.h
@@ -85,8 +103,17 @@ mbrtowc.c
 mbsinit.c
 memchr.c
 memchr.valgrind
+mempcpy.c
+memrchr.c
+mkdir.c
+mkdirat.c
 open-safer.c
 open.c
+openat-die.c
+openat-priv.h
+openat-proc.c
+openat.c
+openat.h
 perror.c
 pipe-safer.c
 printf-args.c
@@ -105,6 +132,10 @@ ref-add.sed
 ref-add.sin
 ref-del.sed
 ref-del.sin
+rmdir.c
+same-inode.h
+save-cwd.c
+save-cwd.h
 signbitd.c
 signbitf.c
 signbitl.c
@@ -127,10 +158,12 @@ stdio_.h
 stdlib.h
 stdlib.in.h
 stdlib_.h
+strdup.c
 streq.h
 strerror.c
 string.h
 string.in.h
+stripslash.c
 sys
 sys_stat.h
 sys_stat.in.h
@@ -147,6 +180,8 @@ unistd-safer.h
 unistd.h
 unistd.in.h
 unistd_.h
+unlink.c
+unlinkat.c
 utimens.c
 utimens.h
 vasnprintf.c
@@ -161,6 +196,8 @@ wctype.in.h
 wctype_.h
 xalloc-die.c
 xalloc.h
+xgetcwd.c
+xgetcwd.h
 xmalloc.c
 xsize.h
 yesno.c
index 765c33e51edf626e4433161597e9d17b53601ba1..701b2adc9327ec259c3630fe1ca35a6e0e5585ad 100644 (file)
@@ -2,13 +2,20 @@
 absolute-header.m4
 alloca.m4
 calloc.m4
+chdir-long.m4
+chown.m4
 clock_time.m4
 close-stream.m4
 close.m4
 closein.m4
 closeout.m4
 codeset.m4
+d-ino.m4
+dirent_h.m4
+dirfd.m4
+dirname.m4
 dos.m4
+double-slash-root.m4
 dup2.m4
 errno_h.m4
 error.m4
@@ -17,9 +24,11 @@ exponentd.m4
 exponentf.m4
 exponentl.m4
 extensions.m4
+fchdir.m4
 fclose.m4
 fcntl-safer.m4
 fcntl_h.m4
+fdopendir.m4
 fflush.m4
 float_h.m4
 fpending.m4
@@ -31,6 +40,9 @@ frexp.m4
 frexpl.m4
 fseeko.m4
 ftello.m4
+getcwd-abort-bug.m4
+getcwd-path-max.m4
+getcwd.m4
 getopt.m4
 getpagesize.m4
 gettime.m4
@@ -48,6 +60,7 @@ inttypes_h.m4
 isnand.m4
 isnanf.m4
 isnanl.m4
+lchown.m4
 ldexpl.m4
 localcharset.m4
 locale-fr.m4
@@ -63,6 +76,9 @@ mbrtowc.m4
 mbsinit.m4
 mbstate_t.m4
 memchr.m4
+mempcpy.m4
+memrchr.m4
+mkdir.m4
 mmap-anon.m4
 mode_t.m4
 multiarch.m4
@@ -76,6 +92,8 @@ printf-posix-rpl.m4
 printf.m4
 quotearg.m4
 realloc.m4
+rmdir.m4
+save-cwd.m4
 signbit.m4
 size_max.m4
 stat-time.m4
@@ -86,6 +104,7 @@ stdint.m4
 stdint_h.m4
 stdio_h.m4
 stdlib_h.m4
+strdup.m4
 strerror.m4
 string_h.m4
 sys_stat_h.m4
@@ -94,6 +113,7 @@ time_h.m4
 timespec.m4
 unistd-safer.m4
 unistd_h.m4
+unlink.m4
 utimbuf.m4
 utimens.m4
 utimes.m4
@@ -105,5 +125,6 @@ wchar_t.m4
 wctype.m4
 wint_t.m4
 xalloc.m4
+xgetcwd.m4
 xsize.m4
 yesno.m4