[llvm] [Support] Report EISDIR when opening a directory (PR #79504)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 25 13:32:29 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 66c710ec9dcdbdec6cadd89b972d8945983dc92f 205f86c29dae1187180dc4230ebe3838d9bc9fed -- llvm/lib/Support/Unix/Path.inc llvm/unittests/Support/CommandLineTest.cpp llvm/unittests/Support/Path.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc
index e6b8a0dd5e..4996d98e57 100644
--- a/llvm/lib/Support/Unix/Path.inc
+++ b/llvm/lib/Support/Unix/Path.inc
@@ -1025,8 +1025,8 @@ std::error_code openFile(const Twine &Name, int &ResultFD,
   if ((ResultFD = sys::RetryAfterSignal(-1, Open)) < 0)
     return std::error_code(errno, std::generic_category());
   if (Access == FA_Read) {
-     struct stat Status;    
-     if (fstat(ResultFD, &Status) == -1)
+    struct stat Status;
+    if (fstat(ResultFD, &Status) == -1)
       return std::error_code(errno, std::generic_category());
     if (S_ISDIR(Status.st_mode))
       return make_error_code(errc::is_a_directory);

``````````

</details>


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


More information about the llvm-commits mailing list