summaryrefslogtreecommitdiff
path: root/src/ln.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-06-19 11:38:16 +0000
committerJim Meyering <jim@meyering.net>2003-06-19 11:38:16 +0000
commit0bf9e8687de32ee1fed6c3471e8cfb2e83364ffc (patch)
tree6e92ac7cd07494de2e33413bac0339c3e65440c4 /src/ln.c
parent2b5eb31b814a9e3d63f35751e46896591285def0 (diff)
downloadcoreutils-0bf9e8687de32ee1fed6c3471e8cfb2e83364ffc.tar.xz
(ENABLE_HARD_LINK_TO_SYMLINK_WARNING): Define to 0.
(do_link): Don't warn about hard link to symlink.
Diffstat (limited to 'src/ln.c')
-rw-r--r--src/ln.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ln.c b/src/ln.c
index f46ad1b23..c653c5dd4 100644
--- a/src/ln.c
+++ b/src/ln.c
@@ -38,6 +38,10 @@
#define AUTHORS N_ ("Mike Parker and David MacKenzie")
+#ifndef ENABLE_HARD_LINK_TO_SYMLINK_WARNING
+# define ENABLE_HARD_LINK_TO_SYMLINK_WARNING 0
+#endif
+
/* For long options that have no equivalent short option, use a
non-character as a pseudo short option, starting with CHAR_MAX + 1. */
enum
@@ -162,7 +166,8 @@ do_link (const char *source, const char *dest)
return 1;
}
- if (S_ISLNK (source_stats.st_mode))
+ if (ENABLE_HARD_LINK_TO_SYMLINK_WARNING
+ && S_ISLNK (source_stats.st_mode))
{
error (0, 0, _("%s: warning: making a hard link to a symbolic link\
is not portable"),