aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Henderson <jh7370@my.bristol.ac.uk>2018-07-26 15:54:53 +0000
committerJames Henderson <jh7370@my.bristol.ac.uk>2018-07-26 15:54:53 +0000
commitec700d4f8fc933ffb67fe75f2cfd4a208d2e7618 (patch)
tree3a8f7fb79233a04ec569289362d0876a8b5079e9
parent6069e66e2cad8d50bdf328b7e6835bd81cd35de5 (diff)
Revert r338027 to pacify build bot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338035 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Support/raw_ostream.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Support/raw_ostream.cpp b/lib/Support/raw_ostream.cpp
index 1dae469958f..038ad00bd60 100644
--- a/lib/Support/raw_ostream.cpp
+++ b/lib/Support/raw_ostream.cpp
@@ -613,10 +613,10 @@ void raw_fd_ostream::write_impl(const char *Ptr, size_t Size) {
assert(FD >= 0 && "File already closed.");
pos += Size;
- // The maximum write size is limited to INT32_MAX. A write
- // greater than SSIZE_MAX is implementation-defined in POSIX,
- // and Windows _write requires 32 bit input.
- size_t MaxWriteSize = INT32_MAX;
+ // The maximum write size is limited to SSIZE_MAX because a write
+ // greater than SSIZE_MAX is implementation-defined in POSIX.
+ // Since SSIZE_MAX is not portable, we use SIZE_MAX >> 1 instead.
+ size_t MaxWriteSize = SIZE_MAX >> 1;
#if defined(__linux__)
// It is observed that Linux returns EINVAL for a very large write (>2G).