]> Dogcows Code - chaz/tar/commitdiff
Obtain root_device here, to make sure it works correctly with -C.
authorSergey Poznyakoff <gray@gnu.org.ua>
Thu, 1 Dec 2005 14:50:57 +0000 (14:50 +0000)
committerSergey Poznyakoff <gray@gnu.org.ua>
Thu, 1 Dec 2005 14:50:57 +0000 (14:50 +0000)
src/extract.c

index c89ebd01e74c4a1acb7abffd0b6fabc3f0e83892..89db09c8b20b81b39554dc590d60360111e18da9 100644 (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);
This page took 0.030917 seconds and 4 git commands to generate.