/* Miscellaneous functions, not really specific to GNU tar.
Copyright 1988, 1992, 1994-1997, 1999-2001, 2003-2007, 2009-2010,
- 2012-2014 Free Software Foundation, Inc.
+ 2012-2014, 2016 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
# define DOUBLE_SLASH_IS_DISTINCT_ROOT 0
#endif
+static void namebuf_add_dir (namebuf_t, char const *);
+static char *namebuf_finish (namebuf_t);
static const char *tar_getcdpath (int);
\f
return -1;
}
- return unlinkat (chdir_fd, file_name, AT_REMOVEDIR);
+ if (unlinkat (chdir_fd, file_name, AT_REMOVEDIR) == 0)
+ {
+ remove_delayed_set_stat (file_name);
+ return 0;
+ }
+ return -1;
}
/* Remove FILE_NAME, returning 1 on success. If FILE_NAME is a directory,
(entrylen = strlen (entry)) != 0;
entry += entrylen + 1)
{
- char *file_name_buffer = new_name (file_name, entry);
+ char *file_name_buffer = make_file_name (file_name, entry);
int r = remove_any_file (file_name_buffer,
RECURSIVE_REMOVE_OPTION);
int e = errno;
diagfn (name);
}
-void
-write_fatal_details (char const *name, ssize_t status, size_t size)
-{
- write_error_details (name, status, size);
- fatal_exit ();
-}
-
/* Fork, aborting if unsuccessful. */
pid_t
xfork (void)
return buf->buffer;
}
-void
+static void
namebuf_add_dir (namebuf_t buf, const char *name)
{
static char dirsep[] = { DIRECTORY_SEPARATOR, 0 };
buf->dir_length += strlen (name);
}
-char *
+static char *
namebuf_finish (namebuf_t buf)
{
char *res = buf->buffer;