/* Create a tar archive.
Copyright (C) 1985, 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 1985-08-25.
file_dumpable_p (struct tar_stat_info *st)
{
if (dev_null_output)
- return totals_option && sparse_option && sparse_file_p (st);
+ return totals_option && sparse_option && ST_IS_SPARSE (st->stat);
return !(st->archive_file_size == 0
&& (st->stat.st_mode & MODE_R) == MODE_R);
}
}
{
- struct timespec mtime = st->mtime;
+ struct timespec mtime = set_mtime_option ? mtime_option : st->mtime;
if (archive_format == POSIX_FORMAT)
{
if (MAX_OCTAL_VAL (header->header.mtime) < mtime.tv_sec
void
create_archive (void)
{
- char *p;
+ const char *p;
open_archive (ACCESS_WRITE);
xheader_write_global ();
exit_status to failure, a clear diagnostic has been issued. */
static void
-dump_file0 (struct tar_stat_info *st, char const *p,
+dump_file0 (struct tar_stat_info *st, const char *p,
int top_level, dev_t parent_device)
{
union block *header;
assign_string (&st->file_name,
safer_name_suffix (p, false, absolute_names_option));
+ transform_name (&st->file_name);
+
if (deref_stat (dereference_option, p, &st->stat) != 0)
{
stat_diag (p);
{
enum dump_status status;
- if (fd != -1 && sparse_option && sparse_file_p (st))
+ if (fd != -1 && sparse_option && ST_IS_SPARSE (st->stat))
{
status = sparse_dump_file (fd, st);
if (status == dump_status_not_implemented)
}
void
-dump_file (char *p, int top_level, dev_t parent_device)
+dump_file (const char *p, int top_level, dev_t parent_device)
{
struct tar_stat_info st;
tar_stat_init (&st);