diff options
author | Pádraig Brady <P@draigBrady.com> | 2013-12-12 18:31:48 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2014-02-10 10:02:34 +0000 |
commit | 9654b67a5443f046dd1e5fe655dc463463f6f9e3 (patch) | |
tree | 1568967d54c11fdf6620f9ed60801bb774d953b2 /tests/cp | |
parent | 6e824a66194528696ba265d6111a6bddce4a8ff8 (diff) | |
download | coreutils-9654b67a5443f046dd1e5fe655dc463463f6f9e3.tar.xz |
cp: with --link always use linkat() if available
* src/copy.c (copy_reg): If linkat() is available it doesn't
matter about the gnulib emulation provided, and thus the
LINK_FOLLOWS_SYMLINKS should not have significance here.
This was noticed on FreeBSD and the consequence is that
cp --link will create hardlinks to symlinks there, rather
than emulating with symlinks to symlinks.
* tests/cp/link-deref.sh: Adjust the checks to cater
for all cases where hardlinks to symlinks are supported.
Diffstat (limited to 'tests/cp')
-rwxr-xr-x | tests/cp/link-deref.sh | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/cp/link-deref.sh b/tests/cp/link-deref.sh index e56d5929e..73c86a889 100755 --- a/tests/cp/link-deref.sh +++ b/tests/cp/link-deref.sh @@ -20,10 +20,9 @@ print_ver_ cp if grep '^#define HAVE_LINKAT 1' "$CONFIG_HEADER" > /dev/null \ - && grep '^#define LINK_FOLLOWS_SYMLINKS 0' "$CONFIG_HEADER" > /dev/null; then - # With this config (which is the case on GNU/Linux) cp will attempt to - # linkat() to hardlink a symlink. So now see if the current file system - # supports this operation. + || grep '^#define LINK_FOLLOWS_SYMLINKS 0' "$CONFIG_HEADER" > /dev/null; then + # With this config cp will attempt to linkat() to hardlink a symlink. + # So now double check the current file system supports this operation. ln -s testtarget test_sl || framework_failure_ ln -P test_sl test_hl_sl || framework_failure_ ino_sl="$(stat -c '%i' test_sl)" || framework_failure_ |