Modernize use of Gnulib, paxutils
* configure.ac: Omit stuff no longer needed now that Gnulib or paxlib does it, or the code no longer needs the configure-time checks. Do not use AC_SYS_LARGEFILE (Gnulib largefile does this) or check for fcntl.h, memory.h, net/errno.h, sgtty.h, string.h, sys/param.h, sys/device.h, sys/gentape.h, sys/inet.h, sys/io/trioctl.h, sys/time.h, sys/tprintf.h, sys/tape.h, unistd.h, locale.h, netdb.h; these are all now standard, or old ways of getting at magtapes are no longer needed and we now have only sys/mtio.h. Do not check for lstat, readlink, symlink, and check only for waitpid’s existence rather than attempting to replace it. Do not check for decls of getgrgid, getpwuid, or time. Check just once for iconv.h. * gnulib.modules: Add largefile. * lib/.gitignore, lib/Makefile.am (noinst_HEADERS, libtar_a_SOURCES): Remove system-ioctl.h, which is no longer in paxlib. All includes now changed to just check HAVE_SYS_MTIO_H directly. * lib/wordsplit.c (wordsplit_c_escape_tab, wordsplit_errstr) (wordsplit_nerrs): Now static or an enum, and without any leading "_" in the name. * src/buffer.c (record_start, record_end, current_block, records_read): * src/delete.c (records_skipped): Add extern decl to pacify GCC. * src/compare.c, src/create.c, src/extract.c: Omit uses of HAVE_READLINK and HAVE_SYMLINK since we now let Gnulib deal with platforms lacking readlinkat and symlinkat. * src/system.c: Use "#if !HAVE_WAITPID" instead of "#if MSDOS".
This commit is contained in:
@@ -1587,7 +1587,6 @@ extract_link (char *file_name, MAYBE_UNUSED int typeflag)
|
||||
static int
|
||||
extract_symlink (char *file_name, MAYBE_UNUSED int typeflag)
|
||||
{
|
||||
#ifdef HAVE_SYMLINK
|
||||
bool interdir_made = false;
|
||||
|
||||
if (! absolute_names_option
|
||||
@@ -1605,6 +1604,19 @@ extract_symlink (char *file_name, MAYBE_UNUSED int typeflag)
|
||||
return 0;
|
||||
|
||||
case RECOVER_NO:
|
||||
if (!implemented (errno))
|
||||
{
|
||||
static bool warned;
|
||||
if (!warned)
|
||||
{
|
||||
warned = true;
|
||||
WARNOPT (WARN_SYMLINK_CAST,
|
||||
(0, 0,
|
||||
_("Attempting extraction of symbolic links"
|
||||
" as hard links")));
|
||||
}
|
||||
return extract_link (file_name, typeflag);
|
||||
}
|
||||
symlink_error (current_stat_info.link_name, file_name);
|
||||
return -1;
|
||||
}
|
||||
@@ -1612,19 +1624,6 @@ extract_symlink (char *file_name, MAYBE_UNUSED int typeflag)
|
||||
set_stat (file_name, ¤t_stat_info, -1, 0, 0,
|
||||
SYMTYPE, false, AT_SYMLINK_NOFOLLOW);
|
||||
return 0;
|
||||
|
||||
#else
|
||||
static int warned_once;
|
||||
|
||||
if (!warned_once)
|
||||
{
|
||||
warned_once = 1;
|
||||
WARNOPT (WARN_SYMLINK_CAST,
|
||||
(0, 0,
|
||||
_("Attempting extraction of symbolic links as hard links")));
|
||||
}
|
||||
return extract_link (file_name, typeflag);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if S_IFCHR || S_IFBLK
|
||||
|
||||
Reference in New Issue
Block a user