diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Support/raw_ostream.cpp | 8 | 
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp index 3e1a8a9765c..0595fe47e12 100644 --- a/llvm/lib/Support/raw_ostream.cpp +++ b/llvm/lib/Support/raw_ostream.cpp @@ -279,7 +279,8 @@ raw_fd_ostream::~raw_fd_ostream() {    if (FD >= 0) {      flush();      if (ShouldClose) -      ::close(FD); +      if (::close(FD) != 0) +        llvm_report_error("IO failure closing output stream.");    }  } @@ -294,13 +295,16 @@ void raw_fd_ostream::close() {    assert (ShouldClose);    ShouldClose = false;    flush(); -  ::close(FD); +  if (::close(FD) != 0) +    llvm_report_error("IO failure closing output stream.");    FD = -1;  }  uint64_t raw_fd_ostream::seek(uint64_t off) {    flush();    pos = ::lseek(FD, off, SEEK_SET); +  if (pos != off) +    llvm_report_error("IO failure seeking on output stream.");    return pos;    }  | 

