]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(copy_internal) [one-file-system]: Do copy mount point
authorJim Meyering <jim@meyering.net>
Sat, 15 Aug 1998 21:16:34 +0000 (21:16 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 15 Aug 1998 21:16:34 +0000 (21:16 +0000)
directories (but none of their entries).  This makes
`cp --one-file-system' work the same way tar does.
From Marty Leisner.

src/copy.c

index 3be9d38257649c84c02a9a62d2452f70d7deddcc..8c5ae54e7a1086a3ccafb3c7d2fc41a9e09a2d22 100644 (file)
@@ -381,10 +381,6 @@ copy_internal (const char *src_path, const char *dst_path,
       return 1;
     }
 
-  /* Are we crossing a file system boundary?  */
-  if (x->one_file_system && device != 0 && device != src_sb.st_dev)
-    return 0;
-
   /* We wouldn't insert a node unless nlink > 1, except that we need to
      find created files so as to not copy infinitely if a directory is
      copied into itself.  */
@@ -661,6 +657,10 @@ copy_internal (const char *src_path, const char *dst_path,
 
          if (x->verbose)
            printf ("%s -> %s\n", src_path, dst_path);
+
+         /* Are we crossing a file system boundary?  */
+         if (x->one_file_system && device != 0 && device != src_sb.st_dev)
+           return 0;
        }
 
       /* Copy the contents of the directory.  */