diff options
author | Jim Meyering <jim@meyering.net> | 1996-02-27 03:24:31 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1996-02-27 03:24:31 +0000 |
commit | edac0ff42083e2d42586caaca849cc5f7a260ede (patch) | |
tree | 8fb229ad040b2715518a427076c449abefdd4746 /src | |
parent | 3f10c64fcad66f003e97b7200193ccc727624ebf (diff) | |
download | coreutils-edac0ff42083e2d42586caaca849cc5f7a260ede.tar.xz |
(copy): Remove bogus (now that we're using full_write) increment of w_partial.
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/dd.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -611,11 +611,9 @@ copy (void) 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) @@ -677,7 +675,7 @@ copy (void) 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); |