Parcourir la source

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>.

Paul Eggert il y a 19 ans
Parent
commit
f2bf9f2ffa
8 fichiers modifiés avec 44 ajouts et 22 suppressions
  1. 14 0
      ChangeLog
  2. 1 0
      lib/.cvsignore
  3. 3 3
      lib/Makefile.tmpl
  4. 4 2
      src/buffer.c
  5. 5 4
      src/compare.c
  6. 7 6
      src/delete.c
  7. 9 7
      src/system.c
  8. 1 0
      src/tar.c

+ 14 - 0
ChangeLog

@@ -1,3 +1,17 @@
+2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
+
+	* bootstrap: Don't claim lib/Makefile.am is generated automatically
+	from itself.
+
+	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>.
+
 2006-02-19  Sergey Poznyakoff  <gray@gnu.org.ua>
 
 	* src/buffer.c (add_chunk_header): Free st.orig_file_name after

+ 1 - 0
lib/.cvsignore

@@ -178,6 +178,7 @@ strtoul.c
 strtoull.c
 strtoumax.c
 sysexit_.h
+system-ioctl.h
 system.h
 time_r.c
 time_r.h

+ 3 - 3
lib/Makefile.tmpl

@@ -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

+ 4 - 2
src/buffer.c

@@ -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)
     {

+ 5 - 4
src/compare.c

@@ -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 *st, int (*processor) (size_t, char *))
   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);

+ 7 - 6
src/delete.c

@@ -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);

+ 9 - 7
src/system.c

@@ -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 **archive_name, int volume_number)
   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 **archive_name, int volume_number)
       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 **archive_name, int volume_number)
 
       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 **archive_name, int volume_number)
 	    free (buf);
 	  return WEXITSTATUS (status);
 	}
-      
+
       free (buf);
       return -1;
     }

+ 1 - 0
src/tar.c

@@ -22,6 +22,7 @@
 #include <system.h>
 
 #include <fnmatch.h>
+#include <getline.h>
 #include <argp.h>
 #include <argp-namefrob.h>