The following reply was made to PR bin/189174; it has been noted by GNATS.

From: Thomas Quinot <tho...@quinot.org>
To: bug-follo...@freebsd.org
Cc:  
Subject: Re: bin/189174: dd conv=sparse bs=64k EINVAL on sparse last block
Date: Thu, 1 May 2014 11:28:25 +0200

 * freebsd-gnats-sub...@freebsd.org, 2014-05-01 :
 
 > >Category:       bin
 > >Responsible:    freebsd-bugs
 > >Synopsis:       dd conv=sparse bs=64k EINVAL on sparse last block
 > >Arrival-Date:   Thu May 01 09:20:00 UTC 2014
 
 The following fix appears to fix the problem here:
 
 Index: dd.c
 ===================================================================
 --- dd.c       (révision 265172)
 +++ dd.c       (copie de travail)
 @@ -450,13 +450,16 @@
                                nw = cnt;
                        } else {
                                if (pending != 0) {
 -                                      if (force)
 +                                      /* If forced to write, and we have no 
data left, we need
 +                                         * to write an explicit 0.
 +                                         */
 +                                      if (force && cnt == 0)
                                                pending--;
                                        if (lseek(out.fd, pending, SEEK_CUR) ==
                                            -1)
                                                err(2, "%s: seek error creating 
sparse file",
                                                    out.name);
 -                                      if (force)
 +                                      if (force && cnt == 0)
                                                write(out.fd, outp, 1);
                                        pending = 0;
                                }
_______________________________________________
freebsd-bugs@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to