From: Jim Meyering Date: Sat, 15 Aug 1998 21:16:34 +0000 (+0000) Subject: (copy_internal) [one-file-system]: Do copy mount point X-Git-Tag: FILEUTILS-3_16u~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d3386199962a2ccc290223292716e3ee8fc2c37;p=thirdparty%2Fcoreutils.git (copy_internal) [one-file-system]: Do copy mount point directories (but none of their entries). This makes `cp --one-file-system' work the same way tar does. From Marty Leisner. --- diff --git a/src/copy.c b/src/copy.c index 3be9d38257..8c5ae54e7a 100644 --- a/src/copy.c +++ b/src/copy.c @@ -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. */