[hackers] [PATCH 4/8] ln: Only fail if same inode without -f flag

From: Michael Forney <mforney_AT_mforney.org>
Date: Fri, 8 Jul 2016 10:24:10 -0700

---
 ln.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/ln.c b/ln.c
index ab1ec4e..f62068a 100644
--- a/ln.c
+++ b/ln.c
_AT_@ -77,9 +77,11 @@ main(int argc, char *argv[])
 					continue;
 				}
 			} else if (st.st_dev == tst.st_dev && st.st_ino == tst.st_ino) {
-				weprintf("%s and %s/%s are the same file\n",
-						*argv, targetdir, target);
-				ret = 1;
+				if (!fflag) {
+					weprintf("%s and %s/%s are the same file\n",
+							*argv, targetdir, target);
+					ret = 1;
+				}
 				continue;
 			}
 		}
-- 
2.6.2
Received on Fri Jul 08 2016 - 19:24:10 CEST

This archive was generated by hypermail 2.3.0 : Fri Jul 08 2016 - 19:36:28 CEST