Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/ln When called as "link" (not currently installed that w...



details:   https://anonhg.NetBSD.org/src/rev/9daf05fa483a
branches:  trunk
changeset: 353164:9daf05fa483a
user:      kre <kre%NetBSD.org@localhost>
date:      Sat Apr 22 12:22:31 2017 +0000

description:
When called as "link" (not currently installed that way) always simply
do a link(2) sys call, never use the internal linkit() routine, which
allows for a destination directory and installs the link inside (and more.)

This makes ln's "link" variant comply with its (currently commented out)
section if its manual page, and also makes it identical to /usr/sbin/link.

diffstat:

 bin/ln/ln.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r cf45f79b5eca -r 9daf05fa483a bin/ln/ln.c
--- a/bin/ln/ln.c       Sat Apr 22 10:37:51 2017 +0000
+++ b/bin/ln/ln.c       Sat Apr 22 12:22:31 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ln.c,v 1.38 2017/04/21 14:46:31 szptvlfn Exp $ */
+/*     $NetBSD: ln.c,v 1.39 2017/04/22 12:22:31 kre Exp $      */
 
 /*-
  * Copyright (c) 1987, 1993, 1994
@@ -44,7 +44,7 @@
 #ifdef __FBSDID
 __FBSDID("$FreeBSD: head/bin/ln/ln.c 251261 2013-06-02 17:55:00Z eadler $");
 #endif
-__RCSID("$NetBSD: ln.c,v 1.38 2017/04/21 14:46:31 szptvlfn Exp $");
+__RCSID("$NetBSD: ln.c,v 1.39 2017/04/22 12:22:31 kre Exp $");
 
 #include <sys/param.h>
 #include <sys/stat.h>
@@ -96,7 +96,9 @@
                argv += optind;
                if (argc != 2)
                        usage();
-               exit(linkit(argv[0], argv[1], 0));
+               if (link(argv[0], argv[1]) == -1)
+                       err(EXIT_FAILURE, NULL);
+               exit(EXIT_SUCCESS);
        }
 
        while ((ch = getopt(argc, argv, "FLPfhinsvw")) != -1)



Home | Main Index | Thread Index | Old Index