Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Apr 2021 02:17:20 GMT
From:      Alan Somers <asomers@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 94db41ccdb93 - stable/13 - mount_nullfs: rename a local variable
Message-ID:  <202104080217.1382HKCa075879@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by asomers:

URL: https://cgit.FreeBSD.org/src/commit/?id=94db41ccdb931f75e597d3b159ea1fa14722174f

commit 94db41ccdb931f75e597d3b159ea1fa14722174f
Author:     Alan Somers <asomers@FreeBSD.org>
AuthorDate: 2021-02-12 18:30:52 +0000
Commit:     Alan Somers <asomers@FreeBSD.org>
CommitDate: 2021-04-08 02:15:00 +0000

    mount_nullfs: rename a local variable
    
    The "source" variable was introduced in r26072, probably as the
    traditional counterpart to "target".  But the "source"/"target" names
    suggest the opposite of their actual meaning.  With ln, for example, the
    source is the real file and the target is the newly created link.  In
    mount_nullfs the meaning is the opposite: the target is the existing
    file system and the source is the newly created mountpoint.  Better to
    use "target"/"mountpoint" terminology, which matches the man page.
    
    Sponsored by:   Axcient
    
    (cherry picked from commit f540cb27a23719d88b7e5143be6e62f75dd25f08)
---
 sbin/mount_nullfs/mount_nullfs.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/sbin/mount_nullfs/mount_nullfs.c b/sbin/mount_nullfs/mount_nullfs.c
index 1fb44eb864af..77ec0991ea9b 100644
--- a/sbin/mount_nullfs/mount_nullfs.c
+++ b/sbin/mount_nullfs/mount_nullfs.c
@@ -66,7 +66,7 @@ main(int argc, char *argv[])
 {
 	struct iovec *iov;
 	char *p, *val;
-	char source[MAXPATHLEN];
+	char mountpoint[MAXPATHLEN];
 	char target[MAXPATHLEN];
 	char errmsg[255];
 	int ch, iovlen;
@@ -97,21 +97,21 @@ main(int argc, char *argv[])
 	if (argc != 2)
 		usage();
 
-	/* resolve target and source with realpath(3) */
+	/* resolve target and mountpoint with realpath(3) */
 	if (checkpath(argv[0], target) != 0)
 		err(EX_USAGE, "%s", target);
-	if (checkpath(argv[1], source) != 0)
-		err(EX_USAGE, "%s", source);
+	if (checkpath(argv[1], mountpoint) != 0)
+		err(EX_USAGE, "%s", mountpoint);
 
 	build_iovec(&iov, &iovlen, "fstype", nullfs, (size_t)-1);
-	build_iovec(&iov, &iovlen, "fspath", source, (size_t)-1);
+	build_iovec(&iov, &iovlen, "fspath", mountpoint, (size_t)-1);
 	build_iovec(&iov, &iovlen, "target", target, (size_t)-1);
 	build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg));
 	if (nmount(iov, iovlen, 0) < 0) {
 		if (errmsg[0] != 0)
-			err(1, "%s: %s", source, errmsg);
+			err(1, "%s: %s", mountpoint, errmsg);
 		else
-			err(1, "%s", source);
+			err(1, "%s", mountpoint);
 	}
 	exit(0);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104080217.1382HKCa075879>