Change sense of the tests (though they're equivalent) that check
the value returned by full_write. making it clearer where errno
is valid. full_write always writes the full amount or fails.
if (ibuf == obuf) /* If not C_TWOBUFS. */
{
int nwritten = full_write (output_fd, obuf, nread);
- if (nwritten != nread)
+ if (nwritten < 0)
{
error (0, errno, "%s", output_file);
- if (nwritten > 0)
- w_partial++;
quit (1);
}
else if (nread == input_blocksize)
int nwritten = full_write (output_fd, obuf, oc);
if (nwritten > 0)
w_partial++;
- if (nwritten != oc)
+ if (nwritten < 0)
{
error (0, errno, "%s", output_file);
quit (1);