summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2008-05-28 19:31:38 +0000
committermillert <millert@openbsd.org>2008-05-28 19:31:38 +0000
commit81cd6c888215b48e859e0bda65343676cfc68fe7 (patch)
treec8ab7f4860f318ad5054a52780d8240cfa3d8511
parentTurns out I have an ISP 12160 myself, and it works fine on sparc64. Since (diff)
downloadwireguard-openbsd-81cd6c888215b48e859e0bda65343676cfc68fe7.tar.xz
wireguard-openbsd-81cd6c888215b48e859e0bda65343676cfc68fe7.zip
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@
-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);
+ }
}
}
/*