summaryrefslogtreecommitdiff
path: root/src/copy.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-06-18 11:17:30 +0200
committerJim Meyering <jim@meyering.net>2007-06-18 15:19:34 +0200
commit0adc02a086c8a40bad3191d14b8612aae5ee9995 (patch)
tree504a0aa1a0037ede3ed2d781bafff966c06b394c /src/copy.c
parent063aa30a3dc226c481bddbf2cbce9f27c83edfc8 (diff)
downloadcoreutils-0adc02a086c8a40bad3191d14b8612aae5ee9995.tar.xz
Use mreadlink_with_size (doesn't exit), not xreadlink_with_size.
* bootstrap.conf (gnulib_modules): Add readlink-with-size. Remove xreadlink and xreadlink-with-size. * src/copy.c (copy_internal): Use mreadlink_with_size, not xreadlink_with_size. * src/ls.c (get_link_name): Likewise. * src/readlink.c (main): Likewise. * src/stat.c (print_stat): Likewise.
Diffstat (limited to 'src/copy.c')
-rw-r--r--src/copy.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/copy.c b/src/copy.c
index 0e9f2d791..fd0519096 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -54,7 +54,7 @@
#include "utimecmp.h"
#include "utimens.h"
#include "write-any-file.h"
-#include "xreadlink.h"
+#include "mreadlink.h"
#include "yesno.h"
#ifndef HAVE_FCHOWN
@@ -1863,7 +1863,7 @@ copy_internal (char const *src_name, char const *dst_name,
}
else if (S_ISLNK (src_mode))
{
- char *src_link_val = xreadlink_with_size (src_name, src_sb.st_size);
+ char *src_link_val = mreadlink_with_size (src_name, src_sb.st_size);
if (src_link_val == NULL)
{
error (0, errno, _("cannot read symbolic link %s"), quote (src_name));
@@ -1884,8 +1884,8 @@ copy_internal (char const *src_name, char const *dst_name,
in some cases, e.g., if the destination symlink has the
wrong ownership, permissions, or time stamps. */
char *dest_link_val =
- xreadlink_with_size (dst_name, dst_sb.st_size);
- if (STREQ (dest_link_val, src_link_val))
+ mreadlink_with_size (dst_name, dst_sb.st_size);
+ if (dest_link_val && STREQ (dest_link_val, src_link_val))
same_link = true;
free (dest_link_val);
}