From f2bf9f2ffa06c0a89a799e64672f58a8e7d0efc7 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 20 Feb 2006 08:15:31 +0000 Subject: [PATCH] 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 , . * src/tar.c: Include . --- ChangeLog | 14 ++++++++++++++ lib/.cvsignore | 1 + lib/Makefile.tmpl | 6 +++--- src/buffer.c | 6 ++++-- src/compare.c | 9 +++++---- src/delete.c | 13 +++++++------ src/system.c | 16 +++++++++------- src/tar.c | 1 + 8 files changed, 44 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 78e6cf6..31425a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2006-02-20 Paul Eggert + + * 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 , . + * src/tar.c: Include . + 2006-02-19 Sergey Poznyakoff * src/buffer.c (add_chunk_header): Free st.orig_file_name after diff --git a/lib/.cvsignore b/lib/.cvsignore index ac25e8d..7280617 100644 --- a/lib/.cvsignore +++ b/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 diff --git a/lib/Makefile.tmpl b/lib/Makefile.tmpl index 1af1052..59542e7 100644 --- a/lib/Makefile.tmpl +++ b/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 diff --git a/src/buffer.c b/src/buffer.c index 81efe32..c0cedc3 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -20,11 +20,13 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include +#include #include #include #include +#include #include #include @@ -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) { diff --git a/src/compare.c b/src/compare.c index 5445ac0..9bcb260 100644 --- a/src/compare.c +++ b/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 +#include #if HAVE_LINUX_FD_H # include @@ -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, ¤t_stat_info.stat)) report_difference (¤t_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 (¤t_stat_info, _("Mod time differs")); if (current_header->header.typeflag != GNUTYPE_SPARSE @@ -423,7 +424,7 @@ diff_multivol (void) } read_and_process (¤t_stat_info, process_rawdata); - + status = close (fd); if (status != 0) close_error (current_stat_info.file_name); diff --git a/src/delete.c b/src/delete.c index 707b024..3e6addd 100644 --- a/src/delete.c +++ b/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 +#include #include "common.h" #include @@ -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 (¤t_stat_info); - + if (status == HEADER_ZERO_BLOCK && ignore_zeros_option) { set_next_block_after (current_header); diff --git a/src/system.c b/src/system.c index 63f9849..612951b 100644 --- a/src/system.c +++ b/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 +#include +#include #include "common.h" #include @@ -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; } diff --git a/src/tar.c b/src/tar.c index 279e1f8..e859f49 100644 --- a/src/tar.c +++ b/src/tar.c @@ -22,6 +22,7 @@ #include #include +#include #include #include -- 2.45.2