bug-tar
[Top][All Lists]
Advanced

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

[Bug-tar] tar/paxutils fixes to port to Solaris 8 with Sun C 5.4


From: Paul Eggert
Subject: [Bug-tar] tar/paxutils fixes to port to Solaris 8 with Sun C 5.4
Date: Mon, 20 Feb 2006 00:25:56 -0800
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

I built tar 1.15.90 on Solaris 8 with Sun C 5.4 (the oldest host I
have ready access to), but it generated some worrisome messages, some
of which will cause compilation failures with more-picky compilers
(e.g., C99 compilers).  These include:

   "buffer.c", line 882: warning: implicit function declaration: gnu_getline
   ...
   cc -DHAVE_CONFIG_H -I. -I. -I.. -I../lib -I../ -I../lib     -g -c misc.c
   "/usr/include/sys/filio.h", line 46: warning: macro redefined: FIOCLEX
   "/usr/include/sys/filio.h", line 47: warning: macro redefined: FIONCLEX
   ...
   "system.c", line 613: warning: implicit function declaration: setenv
   "system.c", line 644: warning: implicit function declaration: unsetenv
   "system.c", line 793: warning: implicit function declaration: gnu_getline
   ...
   "tar.c", line 115: warning: implicit function declaration: gnu_getline

I installed this fix:

2006-02-20  Paul Eggert  <address@hidden>

        Avoid installation glitches on Solaris 8 with Sun C 5.4.
        * lib/.cvsignore: Add system-ioctl.h.
        * lib/Makefile.tmpl (noinst_HEADERS): Add system-ioctl.h.
        * src/buffer.c: Include system-ioctl.h.
        * src/compare.c: Likewise.
        * src/delete.c: Likewise.
        * src/system.c: Include <getline.h>, <setenv.h>.
        * src/tar.c: Include <getline.h>.

        * paxutils/lib/DISTFILES: Add system-ioctl.h.
        * paxutils/lib/system.h: Move the MTIO* stuff into....
        * paxutils/lib/system-ioctl.h: New file.  That way, the symbols defined
        by these includes won't collide with the symbols defined by
        <sys/filio.h> on Solaris when compiling misc.c.
        * paxutils/lib/rtapelib.c: Include system-ioctl.h.
        * paxutils/paxlib/rtape.c: Likewise.
        * paxutils/rmt/rmt.c: Likewise.

--- tar/lib/.cvsignore  7 Feb 2006 23:51:37 -0000       1.31
+++ tar/lib/.cvsignore  20 Feb 2006 08:12:21 -0000
@@ -178,6 +178,7 @@ strtoul.c
 strtoull.c
 strtoumax.c
 sysexit_.h
+system-ioctl.h
 system.h
 time_r.c
 time_r.h
--- tar/lib/Makefile.tmpl       11 Nov 2005 12:16:28 -0000      1.11
+++ tar/lib/Makefile.tmpl       20 Feb 2006 08:12:21 -0000
@@ -1,7 +1,7 @@
 # Makefile for GNU tar library.        -*- Makefile -*-
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2003, 2004, 2005
-# Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2003, 2004,
+# 2005, 2006 Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -19,7 +19,7 @@
 ## 02110-1301, USA.
 
 noinst_LIBRARIES = libtar.a
-noinst_HEADERS = system.h localedir.h rmt.h paxlib.h stdopen.h
+noinst_HEADERS = system.h system-ioctl.h localedir.h rmt.h paxlib.h stdopen.h
 libtar_a_SOURCES = prepargs.c prepargs.h rtapelib.c paxerror.c paxexit.c 
paxnames.c stdopen.c
 
 localedir = $(datadir)/locale
--- tar/src/buffer.c    19 Feb 2006 21:12:50 -0000      1.95
+++ tar/src/buffer.c    20 Feb 2006 08:12:21 -0000
@@ -20,11 +20,13 @@
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 #include <system.h>
+#include <system-ioctl.h>
 
 #include <signal.h>
 
 #include <closeout.h>
 #include <fnmatch.h>
+#include <getline.h>
 #include <human.h>
 #include <quotearg.h>
 
@@ -967,7 +969,7 @@ new_volume (enum access_mode mode)
   static FILE *read_file;
   static int looped;
   int prompt;
-  
+
   if (!read_file && !info_script_option)
     /* FIXME: if fopen is used, it will never be closed.  */
     read_file = archive == STDIN_FILENO ? fopen (TTY_NAME, "r") : stdin;
@@ -991,7 +993,7 @@ new_volume (enum access_mode mode)
       looped = 1;
     }
   prompt = looped;
-  
+
  tryagain:
   if (prompt)
     {
--- tar/src/compare.c   29 Nov 2005 19:14:21 -0000      1.33
+++ tar/src/compare.c   20 Feb 2006 08:12:21 -0000
@@ -1,7 +1,7 @@
 /* Diff files from a tar archive.
 
    Copyright (C) 1988, 1992, 1993, 1994, 1996, 1997, 1999, 2000, 2001,
-   2003, 2004, 2005 Free Software Foundation, Inc.
+   2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 
    Written by John Gilmore, on 1987-04-30.
 
@@ -20,6 +20,7 @@
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 #include <system.h>
+#include <system-ioctl.h>
 
 #if HAVE_LINUX_FD_H
 # include <linux/fd.h>
@@ -139,7 +140,7 @@ read_and_process (struct tar_stat_info *
   union block *data_block;
   size_t data_size;
   size_t size = st->stat.st_size;
-  
+
   mv_begin (st);
   while (size)
     {
@@ -224,7 +225,7 @@ diff_file (void)
       if (!sys_compare_gid (&stat_data, &current_stat_info.stat))
        report_difference (&current_stat_info, _("Gid differs"));
 
-      if (tar_timespec_cmp (get_stat_mtime (&stat_data), 
+      if (tar_timespec_cmp (get_stat_mtime (&stat_data),
                             current_stat_info.mtime))
        report_difference (&current_stat_info, _("Mod time differs"));
       if (current_header->header.typeflag != GNUTYPE_SPARSE
@@ -423,7 +424,7 @@ diff_multivol (void)
     }
 
   read_and_process (&current_stat_info, process_rawdata);
-  
+
   status = close (fd);
   if (status != 0)
     close_error (current_stat_info.file_name);
--- tar/src/delete.c    14 Dec 2005 12:58:56 -0000      1.23
+++ tar/src/delete.c    20 Feb 2006 08:12:21 -0000
@@ -1,7 +1,7 @@
 /* Delete entries from a tar archive.
 
-   Copyright (C) 1988, 1992, 1994, 1996, 1997, 2000, 2001, 2003 Free
-   Software Foundation, Inc.
+   Copyright (C) 1988, 1992, 1994, 1996, 1997, 2000, 2001, 2003, 2004,
+   2005, 2006 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
@@ -18,6 +18,7 @@
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 #include <system.h>
+#include <system-ioctl.h>
 
 #include "common.h"
 #include <rmt.h>
@@ -33,7 +34,7 @@ extern union block *record_end;
 extern union block *current_block;
 extern union block *recent_long_name;
 extern union block *recent_long_link;
-extern off_t records_read; 
+extern off_t records_read;
 extern off_t records_written;
 
 /* The number of records skipped at the start of the archive, when
@@ -184,7 +185,7 @@ delete_archive_members (void)
              skip_member ();
              break;
            }
-         
+
          /* Fall through.  */
        case HEADER_SUCCESS_EXTENDED:
          logical_status = status;
@@ -261,9 +262,9 @@ delete_archive_members (void)
          if (current_block == record_end)
            flush_archive ();
          status = read_header (false);
-         
+
          xheader_decode (&current_stat_info);
-         
+
          if (status == HEADER_ZERO_BLOCK && ignore_zeros_option)
            {
              set_next_block_after (current_header);
--- tar/src/system.c    6 Dec 2005 23:15:14 -0000       1.17
+++ tar/src/system.c    20 Feb 2006 08:12:21 -0000
@@ -1,6 +1,6 @@
 /* System-dependent calls for tar.
 
-   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
@@ -17,6 +17,8 @@
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 #include <system.h>
+#include <getline.h>
+#include <setenv.h>
 
 #include "common.h"
 #include <rmt.h>
@@ -349,7 +351,7 @@ sys_child_open_for_compress (void)
          if (archive < 0)
            {
              int saved_errno = errno;
-             
+
              if (backup_option)
                undo_last_backup ();
              errno = saved_errno;
@@ -772,7 +774,7 @@ sys_exec_info_script (const char **archi
   char *argv[4];
   char uintbuf[UINTMAX_STRSIZE_BOUND];
   int p[2];
-  
+
   xpipe (p);
   pipe_handler = signal (SIGPIPE, SIG_IGN);
 
@@ -787,7 +789,7 @@ sys_exec_info_script (const char **archi
       char *buf;
       size_t size = 0;
       FILE *fp;
-      
+
       xclose (p[PWRITE]);
       fp = fdopen (p[PREAD], "r");
       rc = getline (&buf, &size, fp);
@@ -795,14 +797,14 @@ sys_exec_info_script (const char **archi
 
       if (rc > 0 && buf[rc-1] == '\n')
        buf[--rc] = 0;
-      
+
       while (waitpid (pid, &status, 0) == -1)
        if (errno != EINTR)
          {
            waitpid_error (info_script_option);
            return -1;
          }
-      
+
       if (WIFEXITED (status))
        {
          if (WEXITSTATUS (status) == 0 && rc > 0)
@@ -811,7 +813,7 @@ sys_exec_info_script (const char **archi
            free (buf);
          return WEXITSTATUS (status);
        }
-      
+
       free (buf);
       return -1;
     }
--- tar/src/tar.c       8 Feb 2006 21:34:15 -0000       1.140
+++ tar/src/tar.c       20 Feb 2006 08:12:22 -0000
@@ -22,6 +22,7 @@
 #include <system.h>
 
 #include <fnmatch.h>
+#include <getline.h>
 #include <argp.h>
 #include <argp-namefrob.h>
 
--- paxutils/lib/DISTFILES      6 Sep 2004 13:49:42 -0000       1.1.1.1
+++ paxutils/lib/DISTFILES      20 Feb 2006 08:03:22 -0000
@@ -1,3 +1,4 @@
 rmt.h
 rtapelib.c
 system.h
+system-ioctl.h
--- paxutils/lib/rtapelib.c     29 Nov 2005 19:09:16 -0000      1.3
+++ paxutils/lib/rtapelib.c     20 Feb 2006 08:03:23 -0000
@@ -1,7 +1,7 @@
 /* Functions for communicating with a remote tape drive.
 
-   Copyright 1988, 1992, 1994, 1996, 1997, 1999, 2000, 2001, 2004,
-   2005 Free Software Foundation, Inc.
+   Copyright (C) 1988, 1992, 1994, 1996, 1997, 1999, 2000, 2001, 2004,
+   2005, 2006 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -33,6 +33,8 @@
    code, courtesy of Dan Kegel.  */
 
 #include "system.h"
+#include "system-ioctl.h"
+
 #include <safe-read.h>
 #include <full-write.h>
 
--- paxutils/lib/system.h       29 Nov 2005 19:09:16 -0000      1.6
+++ paxutils/lib/system.h       20 Feb 2006 08:03:23 -0000
@@ -1,7 +1,7 @@
 /* System dependent definitions for GNU tar.
 
    Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003,
-   2004, 2005 Free Software Foundation, Inc.
+   2004, 2005, 2006 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -15,8 +15,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 #if HAVE_CONFIG_H
 # include <config.h>
@@ -392,43 +391,6 @@ extern int errno;
 #define ST_NBLOCKSIZE 512
 #endif
 
-/* This is a real challenge to properly get MTIO* symbols :-(.  ISC uses
-   <sys/gentape.h>.  SCO and BSDi uses <sys/tape.h>; BSDi also requires
-   <sys/tprintf.h> and <sys/device.h> for defining tp_dev and tpr_t.  It
-   seems that the rest use <sys/mtio.h>, which itself requires other files,
-   depending on systems.  Pyramid defines _IOW in <sgtty.h>, for example.  */
-
-#if HAVE_SYS_GENTAPE_H
-# include <sys/gentape.h>
-#else
-# if HAVE_SYS_TAPE_H
-#  if HAVE_SYS_DEVICE_H
-#   include <sys/device.h>
-#  endif
-#  if HAVE_SYS_PARAM_H
-#   include <sys/param.h>
-#  endif
-#  if HAVE_SYS_BUF_H
-#   include <sys/buf.h>
-#  endif
-#  if HAVE_SYS_TPRINTF_H
-#   include <sys/tprintf.h>
-#  endif
-#  include <sys/tape.h>
-# else
-#  if HAVE_SYS_MTIO_H
-#   include <sys/ioctl.h>
-#   if HAVE_SGTTY_H
-#    include <sgtty.h>
-#   endif
-#   if HAVE_SYS_IO_TRIOCTL_H
-#    include <sys/io/trioctl.h>
-#   endif
-#   include <sys/mtio.h>
-#  endif
-# endif
-#endif
-
 /* Declare standard functions.  */
 
 #if STDC_HEADERS
--- /dev/null   2005-09-24 22:00:15.000000000 -0700
+++ paxutils/lib/system-ioctl.h 2006-02-19 23:53:43.000000000 -0800
@@ -0,0 +1,55 @@
+/* System dependent definitions for GNU tar's use of ioctl macros.
+
+   Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003,
+   2004, 2005, 2006 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+/* This is a real challenge to properly get MTIO* symbols :-(.  ISC uses
+   <sys/gentape.h>.  SCO and BSDi uses <sys/tape.h>; BSDi also requires
+   <sys/tprintf.h> and <sys/device.h> for defining tp_dev and tpr_t.  It
+   seems that the rest use <sys/mtio.h>, which itself requires other files,
+   depending on systems.  Pyramid defines _IOW in <sgtty.h>, for example.  */
+
+#if HAVE_SYS_GENTAPE_H
+# include <sys/gentape.h>
+#else
+# if HAVE_SYS_TAPE_H
+#  if HAVE_SYS_DEVICE_H
+#   include <sys/device.h>
+#  endif
+#  if HAVE_SYS_PARAM_H
+#   include <sys/param.h>
+#  endif
+#  if HAVE_SYS_BUF_H
+#   include <sys/buf.h>
+#  endif
+#  if HAVE_SYS_TPRINTF_H
+#   include <sys/tprintf.h>
+#  endif
+#  include <sys/tape.h>
+# else
+#  if HAVE_SYS_MTIO_H
+#   include <sys/ioctl.h>
+#   if HAVE_SGTTY_H
+#    include <sgtty.h>
+#   endif
+#   if HAVE_SYS_IO_TRIOCTL_H
+#    include <sys/io/trioctl.h>
+#   endif
+#   include <sys/mtio.h>
+#  endif
+# endif
+#endif
--- paxutils/paxlib/rtape.c     29 Nov 2005 19:09:16 -0000      1.3
+++ paxutils/paxlib/rtape.c     20 Feb 2006 08:03:23 -0000
@@ -1,7 +1,7 @@
 /* Functions for communicating with a remote tape drive.
 
-   Copyright 1988, 1992, 1994, 1996, 1997, 1999, 2000, 2001, 2004, 2005
-   Free Software Foundation, Inc.
+   Copyright (C) 1988, 1992, 1994, 1996, 1997, 1999, 2000, 2001, 2004,
+   2005, 2006 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -33,6 +33,7 @@
    code, courtesy of Dan Kegel.  */
 
 #include <system.h>
+#include <system-ioctl.h>
 #include <safe-read.h>
 #include <full-write.h>
 #include "localedir.h"
--- paxutils/rmt/rmt.c  7 Feb 2006 23:51:16 -0000       1.10
+++ paxutils/rmt/rmt.c  20 Feb 2006 08:03:23 -0000
@@ -32,6 +32,7 @@
    MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  */
 
 #include "system.h"
+#include "system-ioctl.h"
 #include <closeout.h>
 #include <localedir.h>
 #include <safe-read.h>




reply via email to

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