bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] paxutils minor cleanups for time, sys/time.h, valloc


From: Paul Eggert
Subject: [Bug-tar] paxutils minor cleanups for time, sys/time.h, valloc
Date: Tue, 07 Mar 2006 16:30:27 -0800
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

I noticed from the latest Debian patch that 'tar' checks for valloc
but does not use it.  While fixing that I noticed that it checks for
sys/time.h, unistd.h, and 'time', but those checks aren't needed either.
I installed this simplification into paxutils:

2006-03-07  Paul Eggert  <address@hidden>

        * configure.ac (AC_CHECK_HEADERS): Don't check for sys/time.h,
        since we no longer use HAVE_SYS_TIME_H.
        (AC_CHECK_DECLS): Don't check for 'time', since we assume
        C89 or better.
        * lib/system.h: Include <unistd.h> unconditionally, since we now
        assume the unistd module.
        (time): Remove decl; not needed, since we assume C89 or better.
        Don't bother checking for HAVE_SYS_TIME_H when deciding whether
        to include <sys/time.h>, since TIME_WITH_SYS_TIME implies sys/time.h
        exists.
        * m4/system.m4 (PU_SYSTEM): Don't check for unistd.h or sys/time.h,
        or for time or valloc.

Index: configure.ac
===================================================================
RCS file: /cvsroot/paxutils/paxutils/configure.ac,v
retrieving revision 1.3
diff -p -u -r1.3 configure.ac
--- configure.ac        16 Sep 2005 07:06:09 -0000      1.3
+++ configure.ac        8 Mar 2006 00:25:21 -0000
@@ -1,6 +1,6 @@
 # This file is part of GNU paxutils
 #
-# Copyright (C) 2005 Free Software Foundation, Inc.
+# Copyright (C) 2005, 2006 Free Software Foundation, Inc.
 #
 # GNU paxutils is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by the
@@ -35,7 +35,7 @@ AC_CHECK_HEADERS(fcntl.h linux/fd.h memo
   sgtty.h string.h \
   sys/param.h sys/device.h sys/gentape.h \
   sys/inet.h sys/io/trioctl.h \
-  sys/mtio.h sys/time.h sys/tprintf.h sys/tape.h \
+  sys/mtio.h sys/tprintf.h sys/tape.h \
   unistd.h locale.h)
 
 AC_CHECK_HEADERS([sys/buf.h], [], [],
@@ -93,7 +93,6 @@ PU_SYSTEM
 AC_CHECK_FUNCS(fsync lstat mkfifo readlink strerror symlink setlocale utimes)
 AC_CHECK_DECLS([getgrgid],,, [#include <grp.h>])
 AC_CHECK_DECLS([getpwuid],,, [#include <pwd.h>])
-AC_CHECK_DECLS([time],,, [#include <time.h>])
 
 # Set LIB_SETSOCKOPT to -lnsl -lsocket if necessary.
 tar_save_LIBS=$LIBS
Index: lib/system.h
===================================================================
RCS file: /cvsroot/paxutils/paxutils/lib/system.h,v
retrieving revision 1.7
diff -p -u -r1.7 system.h
--- lib/system.h        20 Feb 2006 08:13:29 -0000      1.7
+++ lib/system.h        8 Mar 2006 00:25:21 -0000
@@ -260,9 +260,7 @@ extern int errno;
 #define MODE_ALL       (S_ISUID | S_ISGID | S_ISVTX | MODE_RWX)
 
 /* Include <unistd.h> before any preprocessor test of _POSIX_VERSION.  */
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
 
 #ifndef SEEK_SET
 # define SEEK_SET 0
@@ -445,12 +443,9 @@ uintmax_t strtoumax ();
 #endif
 
 #include <time.h>
-#if defined(HAVE_SYS_TIME_H) && defined(TIME_WITH_SYS_TIME)
+#ifdef TIME_WITH_SYS_TIME
 # include <sys/time.h>
 #endif
-#if ! HAVE_DECL_TIME
-time_t time ();
-#endif
 
 /* Library modules.  */
 
Index: m4/system.m4
===================================================================
RCS file: /cvsroot/paxutils/paxutils/m4/system.m4,v
retrieving revision 1.4
diff -p -u -r1.4 system.m4
--- m4/system.m4        20 Feb 2006 09:49:50 -0000      1.4
+++ m4/system.m4        8 Mar 2006 00:25:21 -0000
@@ -8,7 +8,7 @@
 AC_DEFUN([PU_SYSTEM],[
   AC_HEADER_STDC
 
-  AC_CHECK_HEADERS_ONCE([string.h memory.h fcntl.h unistd.h sys/wait.h \
+  AC_CHECK_HEADERS_ONCE([string.h memory.h fcntl.h sys/wait.h \
  sys/gentape.h sys/tape.h sys/device.h sys/param.h sys/tprintf.h sys/mtio.h \
  sgtty.h sys/io/trioctl.h inttypes.h locale.h])
 
@@ -17,11 +17,8 @@ AC_DEFUN([PU_SYSTEM],[
 #include <sys/param.h>
 #endif])
 
-  AC_CHECK_HEADERS_ONCE([sys/time.h])
   AC_HEADER_TIME
 
-  AC_CHECK_DECLS_ONCE([time valloc])
-
   AC_CHECK_MEMBERS([struct stat.st_blksize]) dnl instead of 
AC_STRUCT_ST_BLKSIZE
   AC_STRUCT_ST_BLOCKS
   AC_STRUCT_ST_BLKSIZE




reply via email to

[Prev in Thread] Current Thread [Next in Thread]