From owner-dev-commits-src-branches@freebsd.org Thu Apr 8 21:34:25 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C98785C0B8D; Thu, 8 Apr 2021 21:34:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FGZKF4SQ8z4gnj; Thu, 8 Apr 2021 21:34:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 824FC12245; Thu, 8 Apr 2021 21:34:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 138LYP0J015381; Thu, 8 Apr 2021 21:34:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 138LYPCH015380; Thu, 8 Apr 2021 21:34:25 GMT (envelope-from git) Date: Thu, 8 Apr 2021 21:34:25 GMT Message-Id: <202104082134.138LYPCH015380@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 5061d5a0cfaf - stable/12 - mount_nullfs: rename a local variable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5061d5a0cfaf68a6891db82f6bd26ad3e72e87b1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Apr 2021 21:34:25 -0000 The branch stable/12 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=5061d5a0cfaf68a6891db82f6bd26ad3e72e87b1 commit 5061d5a0cfaf68a6891db82f6bd26ad3e72e87b1 Author: Alan Somers AuthorDate: 2021-02-12 18:30:52 +0000 Commit: Alan Somers CommitDate: 2021-04-08 21:32:55 +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 e62f60bd022d..3bb46fdfd66c 100644 --- a/sbin/mount_nullfs/mount_nullfs.c +++ b/sbin/mount_nullfs/mount_nullfs.c @@ -67,7 +67,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; @@ -98,25 +98,25 @@ 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); if (subdir(target, source) || subdir(source, target)) errx(EX_USAGE, "%s (%s) and %s are not distinct paths", argv[0], target, argv[1]); 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); }