[libcxx-commits] [libcxx] [libc++] Fix filesystem::remove_all() on FreeBSD (PR #79540)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jan 25 18:37:06 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff e0ade459917e22f9930559453155537ad2b5e0d8 e66ce8f0af00c848c91453e73532e6c545607d82 -- libcxx/src/filesystem/operations.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libcxx/src/filesystem/operations.cpp b/libcxx/src/filesystem/operations.cpp
index c39a3ee53d..62bb248d5e 100644
--- a/libcxx/src/filesystem/operations.cpp
+++ b/libcxx/src/filesystem/operations.cpp
@@ -817,8 +817,7 @@ uintmax_t remove_all_impl(int parent_directory, const path& p, error_code& ec) {
   // a normal file instead. Note that `openat()` can return either ENOTDIR
   // 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) {
+  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();

``````````

</details>


https://github.com/llvm/llvm-project/pull/79540


More information about the libcxx-commits mailing list