]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(copy): Remove bogus (now that we're using full_write) increment of w_partial.
authorJim Meyering <jim@meyering.net>
Tue, 27 Feb 1996 03:24:31 +0000 (03:24 +0000)
committerJim Meyering <jim@meyering.net>
Tue, 27 Feb 1996 03:24:31 +0000 (03:24 +0000)
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.

src/dd.c

index 858d3e96412677df76970a918ac44ce3dc36f944..f56e554461d18c7d9252548aedfeb554321a79e6 100644 (file)
--- a/src/dd.c
+++ b/src/dd.c
@@ -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);