bug-tar
[Top][All Lists]
Advanced

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

[Bug-tar] Patches for tar-1.13.25


From: Warren Hyde
Subject: [Bug-tar] Patches for tar-1.13.25
Date: Thu, 28 Aug 2003 08:43:09 -0500
User-agent: Mutt/1.3.27i

GNU Tar Maintainers,

I have identified and fixed several problems in the tar-1.13.25 package
while building a copy of it to work on all of the following platforms:

    hppa1.1-hp-hpux10.20
    i686-pc-linux2.4
    rs6000-ibm-aix4.1.5.0
    sparc-sun-solaris2.5.1
    sparc-sun-solaris2.7
    sparc-sun-sunos4.1.3_U1

With these fixes, all 'make check' tests pass on all platforms, and it
works correctly on all of them.  Here's a context diff of the changed
files, and an explanation further below.

diff -rc tar-1.13.25/lib/error.c tar-1.13.25-p1/lib/error.c
*** tar-1.13.25/lib/error.c     2001-09-03 11:39:31.000000000 -0500
--- tar-1.13.25-p1/lib/error.c  2003-08-11 14:10:47.173041000 -0500
***************
*** 188,200 ****
      {
  # if defined HAVE_STRERROR_R || _LIBC
        char errbuf[1024];
        char *s = __strerror_r (errnum, errbuf, sizeof errbuf);
  #  if _LIBC && USE_IN_LIBIO
        if (_IO_fwide (stderr, 0) > 0)
!       __fwprintf (stderr, L": %s", s);
        else
  #  endif
        fprintf (stderr, ": %s", s);
  # else
        fprintf (stderr, ": %s", strerror (errnum));
  # endif
--- 188,214 ----
      {
  # if defined HAVE_STRERROR_R || _LIBC
        char errbuf[1024];
+ #  if defined HAVE_WORKING_STRERROR_R
        char *s = __strerror_r (errnum, errbuf, sizeof errbuf);
+ #  else
+       /* Don't use __strerror_r's return value because on some systems
+          (at least DEC UNIX 4.0[A-D]) strerror_r returns `int'.  */
+       __strerror_r (errnum, errbuf, sizeof errbuf);
+ #  endif
  #  if _LIBC && USE_IN_LIBIO
        if (_IO_fwide (stderr, 0) > 0)
! #   if defined HAVE_WORKING_STRERROR_R
!         __fwprintf (stderr, L": %s", s);
! #   else
!       __fwprintf (stderr, L": %s", errbuf);
! #   endif
        else
  #  endif
+ #  if defined HAVE_WORKING_STRERROR_R
        fprintf (stderr, ": %s", s);
+ #  else
+       fprintf (stderr, ": %s", errbuf);
+ #  endif
  # else
        fprintf (stderr, ": %s", strerror (errnum));
  # endif

diff -rc tar-1.13.25/lib/unicodeio.h tar-1.13.25-p1/lib/unicodeio.h
*** tar-1.13.25/lib/unicodeio.h 2001-09-20 12:02:19.000000000 -0500
--- tar-1.13.25-p1/lib/unicodeio.h      2003-08-11 12:36:52.247006000 -0500
***************
*** 20,25 ****
--- 20,26 ----
  # define UNICODEIO_H
  
  # include <stdio.h>
+ # include <sys/types.h> /* for size_t */
  
  # ifndef PARAMS
  #  if defined PROTOTYPES || (defined __STDC__ && __STDC__)

diff -rc tar-1.13.25/lib/xstrtol.c tar-1.13.25-p1/lib/xstrtol.c
*** tar-1.13.25/lib/xstrtol.c   2001-09-20 13:01:31.000000000 -0500
--- tar-1.13.25-p1/lib/xstrtol.c        2003-08-11 11:51:33.781028000 -0500
***************
*** 87,94 ****
--- 87,97 ----
  #endif
  
  #if !HAVE_DECL_STRTOIMAX
+ /* partain added inner check */
+ #ifndef strtoimax
  intmax_t strtoimax ();
  #endif
+ #endif
  
  #if !HAVE_DECL_STRTOUMAX
  uintmax_t strtoumax ();

diff -rc tar-1.13.25/src/extract.c tar-1.13.25-p1/src/extract.c
*** tar-1.13.25/src/extract.c   2001-09-24 13:55:17.000000000 -0500
--- tar-1.13.25-p1/src/extract.c        2003-08-11 11:50:00.534071000 -0500
***************
*** 402,407 ****
--- 402,411 ----
          /* Turbo C mkdir gives a funny errno.  */
          || errno == EACCES
  #endif
+         /* Automount directories, even when automounted, return ENOSYS. */
+         /* The proper thing to do, in any case, is to check to see if it */
+         /* really exists, instead of checking for which error came back. */
+         || errno == ENOSYS
          )
        /* Directory already exists.  */
        continue;


Here is a ChangeLog-style explanation for the fixes:

2003-08-11  Warren Hyde  <address@hidden>

        * lib/error.c (error_tail): Check for HAVE_WORKING_STRERROR_R before
          assuming __strerror_r will give us a char*.  Fixes HP-UX 10.20.

        * lib/unicodeio.h: Make sure <sys/types.h> is included to get size_t.
          Fixes SunOS 4.1.x.

        * lib/xstrtol.c: Make sure strtoimax is defined, since we only check
          strtoumax properly.  Fixes HP-UX 10.20.

        * src/extract.c (make_directories): Automount directories will give
          an ENOSYS instead of EEXIST if an automounted path already exists
          when extracting files.  Don't assume this is a failure (Solaris).

-- 
POPI classification:
[x] General Business Information
[ ] Motorola Internal Use
[ ] Motorola Confidential Proprietary
[ ] Likely Incorrect

Cheers,
--
address@hidden
Authorities Seek Those Responsible for Massive Canine Escape.
    --Songs Re-Written as News Headlines. [topfive.com]


----- End forwarded message -----

-- 
POPI classification:
[ ] General Business Information
[x] Motorola Internal Use
[ ] Motorola Confidential Proprietary
[ ] Thoughtless Tripe

Cheers,
--
address@hidden
Gasoline Still Inexplicably Cheaper Than Milk. --The Onion




reply via email to

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