Hi all,
Use of 'dd conv=noerror,sync' with a reasonably large blocksize (large enough 
to not be a clean multiple of the input size), generates an incorrect summary. 
The blocks out will report 'XXXXX+0' rather than '+1' indicating a partial 
block write.

The erroneous code is here:
      if (ibuf == obuf)         /* If not C_TWOBUFS. */
        {
          int nwritten = full_write (output_fd, obuf, nread);
          if (nwritten < 0)
            {
              error (0, errno, "%s", output_file);
              quit (1);
            }
          else if (nread == input_blocksize)
            w_full++;
          else
            w_partial++;
          continue;
        }

The

else if (nread == input_blocksize)

should read

else if (nwritten == input_blocksize)

because when conv=sync is specified, nread gets reset to input_blocksize. We want to 
know if we wrote a partial block, not if we read one.

Regards,

Tim

-- 
Tim Wright                        | Aracnet -- Portland's loudest electrons
[EMAIL PROTECTED] OR               | Ring +1 503 906 8997 V.90 (56K) 24hrs
[EMAIL PROTECTED]                | Browse http://www.aracnet.com for info!
"Nobody ever said I was charming, they said "Rimmer, you're a git!"" RD VI



_______________________________________________
Bug-fileutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-fileutils

Reply via email to