Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

NumRead is already of ssize_t.

NumRead is already of ssize_t.
@llvmbot
Copy link
Member

llvmbot commented Jul 29, 2025

@llvm/pr-subscribers-llvm-support

Author: Kazu Hirata (kazutakahirata)

Changes

NumRead is already of ssize_t.


Full diff: https://github.com/llvm/llvm-project/pull/151083.diff

1 Files Affected:

  • (modified) llvm/lib/Support/Unix/Path.inc (+1-1)
diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc
index 277247e3cc236..cc02cae40ec76 100644
--- a/llvm/lib/Support/Unix/Path.inc
+++ b/llvm/lib/Support/Unix/Path.inc
@@ -1190,7 +1190,7 @@ Expected<size_t> readNativeFile(file_t FD, MutableArrayRef<char> Buf) {
   size_t Size = Buf.size();
 #endif
   ssize_t NumRead = sys::RetryAfterSignal(-1, ::read, FD, Buf.data(), Size);
-  if (ssize_t(NumRead) == -1)
+  if (NumRead == -1)
     return errorCodeToError(errnoAsErrorCode());
 // The underlying operation on these platforms allow opening directories
 // for reading in more cases than other platforms.

@kazutakahirata kazutakahirata merged commit 5e150bb into llvm:main Jul 29, 2025
11 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250728_cast_llvm_Support branch July 29, 2025 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants