Obtain root_device here, to make sure it works correctly with -C.

This commit is contained in:
Sergey Poznyakoff
2005-12-01 14:50:57 +00:00
parent 888b0d82b7
commit ca43ee9769

View File

@@ -120,19 +120,6 @@ extr_init (void)
same_permissions_option += we_are_root;
same_owner_option += we_are_root;
/* Save 'root device' to avoid purging mount points.
FIXME: Should the same be done after handling -C option ? */
if (one_file_system_option)
{
struct stat st;
char *dir = xgetcwd ();
if (deref_stat (true, dir, &st))
stat_diag (dir);
else
root_device = st.st_dev;
}
/* Option -p clears the kernel umask, so it does not affect proper
restoration of file permissions. New intermediate directories will
comply with umask at start of program. */
@@ -626,6 +613,19 @@ extract_dir (char *file_name, int typeflag)
mode_t mode;
int interdir_made = 0;
/* Save 'root device' to avoid purging mount points. */
if (one_file_system_option && root_device == 0)
{
struct stat st;
char *dir = xgetcwd ();
if (deref_stat (true, dir, &st))
stat_diag (dir);
else
root_device = st.st_dev;
free (dir);
}
if (incremental_option)
/* Read the entry and delete files that aren't listed in the archive. */
purge_directory (file_name);