Skip to content
Commit 9e5b4983 authored by Saleem Abdulrasool's avatar Saleem Abdulrasool
Browse files

driver: handle write error better

We would previously simply assume that the write would always succeed.  However,
write(2) may return -1 for error as well as fail to perform a complete write (in
which case the returned number of bytes will be less than the requested bytes).

Explicitly check if an error condition is encountered.  This would previously
not be caught as we default initialized success to true.  Add an assertion that
we always perform a complete write (a continuous retry could be added to ensure
that we finish writing completely).

This was caught by GCC's signed comparison warning and manual inspection.

llvm-svn: 217355
parent 09716297
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment