From: Jim Meyering Date: Sun, 7 Nov 1999 11:07:53 +0000 (+0000) Subject: (do_link): Warn that making a hard link to a symbolic link is not portable. X-Git-Tag: FILEUTILS-4_0j-trial~58 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=224fff6a3a026124d8efb07f8b66645b8901832e;p=thirdparty%2Fcoreutils.git (do_link): Warn that making a hard link to a symbolic link is not portable. --- diff --git a/src/ln.c b/src/ln.c index 5307d67cc0..759c450b32 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);