summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2014-04-10 17:09:57 +0100
committerPádraig Brady <P@draigBrady.com>2014-04-10 17:11:25 +0100
commite9cb3eb6cee714865eff7a29e6c2101e545617c2 (patch)
treebb3614ddb3b6792eb644d30b9d7834708852dcb2 /src
parentd2980924ac05bbee579bd71e551128f3b02327f1 (diff)
downloadcoreutils-e9cb3eb6cee714865eff7a29e6c2101e545617c2.tar.xz
maint: avoid static analysis warnings in ln.c
* src/ln.c (do_link): It's not obvious that record_file() is a noop in the symlink case (in that case dest_set is NULL and so ignored). So to make it obvious, and to avoid false positives seen in coverity, add the explicit condition here.
Diffstat (limited to 'src')
-rw-r--r--src/ln.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ln.c b/src/ln.c
index 67266997e..42bccfce7 100644
--- a/src/ln.c
+++ b/src/ln.c
@@ -343,7 +343,8 @@ do_link (const char *source, const char *dest)
{
/* Right after creating a hard link, do this: (note dest name and
source_stats, which are also the just-linked-destinations stats) */
- record_file (dest_set, dest, &source_stats);
+ if (! symbolic_link)
+ record_file (dest_set, dest, &source_stats);
if (verbose)
{