gl_EARLY
AC_CHECK_TOOLS([AR], [ar])
-AC_SYS_LARGEFILE
-
-AC_CHECK_HEADERS_ONCE(fcntl.h linux/fd.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/mtio.h sys/time.h sys/tprintf.h sys/tape.h \
- unistd.h locale.h)
-
-AC_CHECK_HEADERS([sys/buf.h], [], [],
-[#if HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif])
+AC_CHECK_HEADERS_ONCE([linux/fd.h sys/mtio.h])
AC_HEADER_MAJOR
TAR_HEADERS_ATTR_XATTR_H
-AC_CHECK_FUNCS_ONCE([fchmod fchown fsync lstat mkfifo readlink symlink])
-
-AC_CHECK_DECLS([getgrgid],,, [#include <grp.h>])
-AC_CHECK_DECLS([getpwuid],,, [#include <pwd.h>])
-AC_CHECK_DECLS([time],,, [#include <time.h>])
-
-AC_REPLACE_FUNCS(waitpid)
+AC_CHECK_FUNCS_ONCE([fchmod fchown fsync mkfifo waitpid])
AC_ARG_VAR([RSH], [Configure absolute path to default remote shell binary])
AC_CACHE_CHECK(for remote shell, tar_cv_path_RSH,
fi
done
fi])
-if test $tar_cv_path_RSH = no; then
- AC_CHECK_HEADERS(netdb.h)
-else
+if test $tar_cv_path_RSH != "no"; then
AC_DEFINE_UNQUOTED(REMOTE_SHELL, "$tar_cv_path_RSH",
[Define to the full path of your rsh, if any.])
fi
# Iconv
AM_ICONV
-AC_CHECK_HEADERS(iconv.h)
+AC_CHECK_HEADERS_ONCE([iconv.h])
AC_CHECK_TYPE(iconv_t,:,
AC_DEFINE(iconv_t, int,
[Conversion descriptor type]),
idx
inttostr
inttypes
+largefile
lchown
linkat
localcharset
rmt-command.h
rmt.h
rtapelib.c
-system-ioctl.h
system.h
paxlib.h\
rmt.h\
system.h\
- system-ioctl.h\
wordsplit.h\
xattr-at.h
paxerror.c paxexit-status.c paxlib.h paxnames.c \
rtapelib.c \
rmt.h \
- system.h system-ioctl.h \
+ system.h \
wordsplit.c\
xattr-at.c
wsp->ws_errno = 0;
}
-char wordsplit_c_escape_tab[] = "\\\\\"\"a\ab\bf\fn\nr\rt\tv\v";
+static char wordsplit_c_escape_tab[] = "\\\\\"\"a\ab\bf\fn\nr\rt\tv\v";
static int
wordsplit_init (struct wordsplit *wsp, const char *input, size_t len,
return 0;
}
-const char *_wordsplit_errstr[] = {
+static char const *const wordsplit_errstr[] = {
N_("no error"),
N_("missing closing quote"),
N_("memory exhausted"),
N_("unbalanced parenthesis"),
N_("globbing error")
};
-int _wordsplit_nerrs =
- sizeof (_wordsplit_errstr) / sizeof (_wordsplit_errstr[0]);
+enum { wordsplit_nerrs = sizeof wordsplit_errstr / sizeof *wordsplit_errstr };
const char *
wordsplit_strerror (struct wordsplit *ws)
{
if (ws->ws_errno == WRDSE_USERERR)
return ws->ws_usererr;
- if (ws->ws_errno < _wordsplit_nerrs)
- return _wordsplit_errstr[ws->ws_errno];
+ if (ws->ws_errno < wordsplit_nerrs)
+ return wordsplit_errstr[ws->ws_errno];
return N_("unknown error");
}
/* FIXME: The following variables should ideally be static to this
module. However, this cannot be done yet. The cleanup continues! */
+extern union block *record_start;
union block *record_start; /* start of record of archive */
+extern union block *record_end;
union block *record_end; /* last+1 block of archive record */
+extern union block *current_block;
union block *current_block; /* current block of archive */
enum access_mode access_mode; /* how do we handle the archive */
+extern off_t records_read;
off_t records_read; /* number of records read from this archive */
off_t records_written; /* likewise, for records written */
extern off_t records_skipped; /* number of records skipped at the start
Written by John Gilmore, on 1987-04-30. */
#include <system.h>
-#include <system-ioctl.h>
#if HAVE_LINUX_FD_H
# include <linux/fd.h>
#endif
+#if HAVE_SYS_MTIO_H
+# include <sys/ioctl.h>
+# include <sys/mtio.h>
+#endif
+
#include "common.h"
#include <quotearg.h>
#include <rmt.h>
current_stat_info.link_name));
}
-#ifdef HAVE_READLINK
static void
diff_symlink (void)
{
if (linkbuf != buf)
free (linkbuf);
}
-#endif
static void
diff_special (void)
diff_link ();
break;
-#ifdef HAVE_READLINK
case SYMTYPE:
diff_symlink ();
break;
-#endif
case CHRTYPE:
case BLKTYPE:
return allocated;
}
-#ifdef HAVE_READLINK
else if (S_ISLNK (st->stat.st_mode))
{
st->link_name = areadlinkat_with_size (parentfd, name, st->stat.st_size);
file_count_links (st);
return allocated;
}
-#endif
else if (S_ISCHR (st->stat.st_mode))
{
type = CHRTYPE;
/* The number of records skipped at the start of the archive, when
passing over members that are not deleted. */
+extern off_t records_skipped;
off_t records_skipped;
/* Move archive descriptor by COUNT records worth. If COUNT is
static int
extract_symlink (char *file_name, MAYBE_UNUSED int typeflag)
{
-#ifdef HAVE_SYMLINK
bool interdir_made = false;
if (! absolute_names_option
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;
}
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
with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <system.h>
-#include <system-ioctl.h>
+
+#if HAVE_SYS_MTIO_H
+# include <sys/ioctl.h>
+# include <sys/mtio.h>
+#endif
#include "common.h"
#include <priv-set.h>
return false;
}
-#if MSDOS
+#if !HAVE_WAITPID /* MingW, MSVC 14. */
bool
sys_get_archive_stat (void)