From nobody Mon Jan 29 17:28:24 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 4TNwHr3G4Jz5953c; Mon, 29 Jan 2024 17:28:24 +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 4TNwHr2n3yz4vlR; Mon, 29 Jan 2024 17:28:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706549304; 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=2W7b65v12NTCg3ZXKRvSIDX1TqHSRyWamEKPA6ZjLTs=; b=GZQbEwmQv+RebmJ/wdA7iFEOS5Lnf5szamO98AwcS1Df4xyrCjyVD13K8dea6cwqOiioyW SQY8d1qYivEe+zfNLXn6DOR7i7HeXQA/npBYus2lKA4O4YdQSFfzIBU9hV/13w6JEz5kgn UhA02q2SIvvHr154KftCjlvwkF1h5sKYqWQOQpB0JFi0AsFe47aiAks6H+tQfrTs0KedtX U9lKgn4yTvhmZaGUHwp9emNrMIb4UNBMa+1WrbNiJ4MWusk65eiTAOznSVK/+3pvWXPci9 P/J55imvI4c8KdVZ6f2reDLBQ/ItWb8HHiDbOnW50Nhtmsh90Agusl3Li4N/vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706549304; 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=2W7b65v12NTCg3ZXKRvSIDX1TqHSRyWamEKPA6ZjLTs=; b=HEab8I3+D956C3xlkh4OHR3DAPpQbitwxErqqiQ6efH4CygIi7F0rgnyL8+2eZaVazDAzp x6O37XbdhvtznO4IAyvIZytNRwdl/TXVFAs89w53UTB6BFHYPCM05S886ecZAH7+pn7kb+ H5fOAtYjVSmSxONQUGN3mECyh7iPaaTBSNCYa6iLYLFWiBihmsp4PNQtsj14UOboyzqbh+ FENICXVQt5lAtbrTjQUB+bkVzKvd0M2EocmRzXOGyrrV4VgqueUbMcUoyC8WyBOqdGZW4H vWGIt4KPHn7aAmo1NLP/L739CaV1vTcZ7YX58HhdrOytYCq4rPFrFe6Dir28YQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706549304; a=rsa-sha256; cv=none; b=UAVu6pWWHgrNb+N+0omVgasMiaAANx5Xf67z4LenP9leasfNu4kPVQZZTpfZBHSK5qmudB rUiVW7T4Tko+iXNQVNLPKxCocX8GZcAhkaa+urGMMMnp9eHsrtimzIbM8P32JtPbzMueFr QYjBKdBjD+LEoGD9r4VnR9mQ0pNZQ74dFYvhFWo6cKwn+85gKcXEdTgO7eoE9u3HYh5Mtb z70wPdj5pbs6//76HKPRRPoyKqBiCo9CyL2eHBYbG4HEcTY/lunIj1OaYSLSVuDKEAdbam zCGhX/0E66i5lc5QYW0OuIY1K1j9eGAX+ht+CxnGBAVghqAqva2LPj+/eZmw8g== 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 4TNwHr1rhGz118h; Mon, 29 Jan 2024 17:28:24 +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 40THSOeT089035; Mon, 29 Jan 2024 17:28:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40THSO75089032; Mon, 29 Jan 2024 17:28:24 GMT (envelope-from git) Date: Mon, 29 Jan 2024 17:28:24 GMT Message-Id: <202401291728.40THSO75089032@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: ee14a9725d73 - main - Merge commit 4a39d0890894 from llvm-project (by Mark Johnston): 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ee14a9725d73150e89367550206803fe36ae3089 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=ee14a9725d73150e89367550206803fe36ae3089 commit ee14a9725d73150e89367550206803fe36ae3089 Author: Dimitry Andric AuthorDate: 2024-01-29 17:26:48 +0000 Commit: Dimitry Andric CommitDate: 2024-01-29 17:26:48 +0000 Merge commit 4a39d0890894 from llvm-project (by Mark Johnston): [libc++] Fix filesystem::remove_all() on FreeBSD (#79540) remove_all_impl() opens the target path with O_NOFOLLOW, which fails if the target is a symbolic link. On FreeBSD, rather than returning ELOOP, openat() returns EMLINK. This is unlikely to change for compatibility reasons, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214633 . Thus, check for EMLINK as well. Reported by: markj PR: 276632 MFC after: 3 days --- contrib/llvm-project/libcxx/src/filesystem/operations.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/llvm-project/libcxx/src/filesystem/operations.cpp b/contrib/llvm-project/libcxx/src/filesystem/operations.cpp index 63a119aa983e..1877bcd79f4d 100644 --- a/contrib/llvm-project/libcxx/src/filesystem/operations.cpp +++ b/contrib/llvm-project/libcxx/src/filesystem/operations.cpp @@ -823,8 +823,9 @@ uintmax_t remove_all_impl(int parent_directory, const path& p, error_code& ec) { // If opening `p` failed because it wasn't a directory, remove it as // a normal file instead. Note that `openat()` can return either ENOTDIR - // or ELOOP depending on the exact reason of the failure. - if (ec == errc::not_a_directory || ec == errc::too_many_symbolic_link_levels) { + // or ELOOP depending on the exact reason of the failure. On FreeBSD it + // may return EMLINK instead of ELOOP, contradicting POSIX. + if (ec == errc::not_a_directory || ec == errc::too_many_symbolic_link_levels || ec == errc::too_many_links) { ec.clear(); if (::unlinkat(parent_directory, p.c_str(), /* flags = */0) == -1) { ec = detail::capture_errno();