From nobody Wed Apr 17 02:04:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VK42q1H0Cz5HZ5B; Wed, 17 Apr 2024 02:04:03 +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 4VK42q0dcLz4FvD; Wed, 17 Apr 2024 02:04:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713319443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tBjmcHOPAyxcyCB/Gvjr9Zd8MV+f9v7pD809VGWAsPU=; b=r9B2G53txmNG+H+d+l3je+NV9J3R/jtYHhsxYUNR2Rf6uGwwNdCRMzDzPdDPmf4LhdGtfB qyoxwH8J85rNEI0IVVj23jG7/jXt28Jhe9gvKWxWe3wr2rMwAd3Wc9+SUme+JHvnr6Wesz QkP0L9eJWb51S5hKg8QB9WIBaGj9ouQPOhd9QhRxjPersSHsYTA5AAzkexftOwR56OypaK xbsbQCypuxOwiEsEJKdUaH1PSxXq1slITjHoo7ep4jDYpY4xXVwQKz6tPNTY2Ba2BuiQwx RIr4uQh/5HguQ3PW95gycDgQthACmSyMyGjm4jWv79VSvFVLTSs9NJSJF7bk5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713319443; a=rsa-sha256; cv=none; b=pzhOrL3EUYtkYHtzOeBCXIDsCkL8ZsxOnkji72ZKZ/4Aydxfdd4nZ3g1TykoUIrhf1Y7Al gIDoxXgAZLyxoRstOb4NS+CppU8t8vg/N91im2c6KN/w79ynVpSyymxWQjseUKGs4wZWZf 9y0jfR8zzoo75lKGorQYWy+eq6wsE1mtwS0sQl56a0gooaql6lEdamwBKsklw2LM9iRJXt Lo3BoM2VrMi5QJLNmculnpdV5OFl26js8ci7FsNky0uHrzfs0QsmLklx9/gkEUFrG+avTE PMYEYuypVGsvyYP48ApWky4OtZLkCuimjUeCOoyeb5osbynPIDdA3p6BiF+QAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713319443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tBjmcHOPAyxcyCB/Gvjr9Zd8MV+f9v7pD809VGWAsPU=; b=Z8zRYm+QbATwzgmBvmS0utGxaq1NB5647BzRmDFTo3DJMTybEjDXfs9VxsHMZxnXSZLCgw Mkg/afbvA64tRWHldKAxA+iIY19XSojFgkCJRKZTbmCp7vXZUoEk6FHZayahuEQ3YyS2lO bVJHvSkRiA5Kl/NIvxdQBdVjOUDXoKdy17JclRTcAxjmtMCOC19VbbXFbz1fpdEP8NXl2J s0LY+v7RzQrt7OqbDg5IwFpybOv4rQ8utWOY/zQMw39CRBUzr/yKRVHlYA6MoC+HLQuGma bkt1q2hoGueesMQur+l1TTzL2TMVRGIWG3Gda7X2xDukCb6DlvBkIIlRguVupQ== 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 4VK42q0Fcsz178t; Wed, 17 Apr 2024 02:04:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43H242Qm033881; Wed, 17 Apr 2024 02:04:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43H242ll033878; Wed, 17 Apr 2024 02:04:02 GMT (envelope-from git) Date: Wed, 17 Apr 2024 02:04:02 GMT Message-Id: <202404170204.43H242ll033878@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 64d6925d1901 - main - cp: Clarify an obscure comment. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 64d6925d1901637125f9f739282e72c992657dc8 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=64d6925d1901637125f9f739282e72c992657dc8 commit 64d6925d1901637125f9f739282e72c992657dc8 Author: Dag-Erling Smørgrav AuthorDate: 2024-04-17 01:36:22 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-17 02:03:21 +0000 cp: Clarify an obscure comment. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D44805 --- bin/cp/cp.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/cp/cp.c b/bin/cp/cp.c index cee412e57264..98697ba2b06f 100644 --- a/bin/cp/cp.c +++ b/bin/cp/cp.c @@ -452,13 +452,19 @@ copy(char *argv[], enum op type, int fts_options, struct stat *root_stat) switch (curr->fts_statp->st_mode & S_IFMT) { case S_IFLNK: - /* Catch special case of a non-dangling symlink. */ if ((fts_options & FTS_LOGICAL) || ((fts_options & FTS_COMFOLLOW) && curr->fts_level == 0)) { + /* + * We asked FTS to follow links but got + * here anyway, which means the target is + * nonexistent or inaccessible. Let + * copy_file() deal with the error. + */ if (copy_file(curr, dne)) badcp = rval = 1; - } else { + } else { + /* Copy the link. */ if (copy_link(curr, !dne)) badcp = rval = 1; }