[llvm-commits] [llvm] r75758 - /llvm/trunk/lib/Support/raw_ostream.cpp

Eli Friedman eli.friedman at gmail.com
Thu Jul 16 03:19:32 PDT 2009


On Wed, Jul 15, 2009 at 1:12 AM, Daniel Dunbar<daniel at zuster.org> wrote:
> @@ -285,7 +286,8 @@
>  void raw_fd_ostream::write_impl(const char *Ptr, unsigned Size) {
>   assert (FD >= 0 && "File already closed.");
>   pos += Size;
> -  ::write(FD, Ptr, Size);
> +  if (::write(FD, Ptr, Size) != (ssize_t) Size)
> +    llvm_report_error("IO failure writing to output stream.");
>  }

This isn't really right... unlike fwrite(), the fact that the returned
value from write() isn't the same as the input parameter doesn't
necessarily indicate an error.

-Eli




More information about the llvm-commits mailing list