summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2008-05-28 19:31:39 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2008-05-28 19:31:39 +0000
commit55a33c621b62df8cf857e114a6bbd233fd42255b (patch)
treeb2fa0c06c80dfca95c80f520358960e1ede85f24 /bin
parent7e02e96cc1ca2473a40ac3565cf9ca42ee1b9c54 (diff)
In -f mode, don't print a warning if source and target already point
to the same inode. This is consistent with other implementations. OK deraadt@ miod@ ray@
Diffstat (limited to 'bin')
-rw-r--r--bin/ln/ln.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/bin/ln/ln.c b/bin/ln/ln.c
index 25a8386282c..ac8e7ce9040 100644
--- a/bin/ln/ln.c
+++ b/bin/ln/ln.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ln.c,v 1.16 2007/09/16 18:13:57 sobrado Exp $ */
+/* $OpenBSD: ln.c,v 1.17 2008/05/28 19:31:38 millert Exp $ */
/* $NetBSD: ln.c,v 1.10 1995/03/21 09:06:10 cgd Exp $ */
/*
@@ -40,7 +40,7 @@ static const char copyright[] =
#if 0
static const char sccsid[] = "@(#)ln.c 8.2 (Berkeley) 3/31/94";
#else
-static const char rcsid[] = "$OpenBSD: ln.c,v 1.16 2007/09/16 18:13:57 sobrado Exp $";
+static const char rcsid[] = "$OpenBSD: ln.c,v 1.17 2008/05/28 19:31:38 millert Exp $";
#endif
#endif /* not lint */
@@ -177,12 +177,13 @@ linkit(char *target, char *source, int isdir)
}
if (tsb.st_dev == sb.st_dev && tsb.st_ino == sb.st_ino) {
- warnx("%s and %s are identical (nothing done).",
- target, source);
if (fflag)
return (0);
- else
+ else {
+ warnx("%s and %s are identical (nothing done).",
+ target, source);
return (1);
+ }
}
}
/*