summaryrefslogtreecommitdiff
path: root/src/ln.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-11-07 11:07:53 +0000
committerJim Meyering <jim@meyering.net>1999-11-07 11:07:53 +0000
commit224fff6a3a026124d8efb07f8b66645b8901832e (patch)
tree1155755e816155069b463962999efecaca2fad18 /src/ln.c
parent7876eafaa1476a73cbd4270a2dfe084ba1cfdaa6 (diff)
downloadcoreutils-224fff6a3a026124d8efb07f8b66645b8901832e.tar.xz
(do_link): Warn that making a hard link to a symbolic link is not portable.
Diffstat (limited to 'src/ln.c')
-rw-r--r--src/ln.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ln.c b/src/ln.c
index 5307d67cc..759c450b3 100644
--- a/src/ln.c
+++ b/src/ln.c
@@ -164,6 +164,13 @@ do_link (const char *source, const char *dest)
return 1;
}
+ if (S_ISLNK (source_stats.st_mode))
+ {
+ error (0, 0, _("%s: warning: making a hard link to a symbolic link\
+ is not portable"),
+ source);
+ }
+
if (!hard_dir_link && S_ISDIR (source_stats.st_mode))
{
error (0, 0, _("%s: hard link not allowed for directory"), source);