From: Jim Meyering Date: Fri, 4 Jun 2004 17:43:55 +0000 (+0000) Subject: (dopass): Don't subtract 1 from the offset after X-Git-Tag: v5.3.0~1402 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=657842c6939531b731f5f2d787feb1094ff3b999;p=thirdparty%2Fcoreutils.git (dopass): Don't subtract 1 from the offset after a write error. Problem reported by Jon Peatfield in: http://lists.gnu.org/archive/html/bug-coreutils/2004-06/msg00020.html --- diff --git a/src/shred.c b/src/shred.c index 641cef8ee6..0d66c1cd29 100644 --- a/src/shred.c +++ b/src/shred.c @@ -921,7 +921,8 @@ dopass (int fd, char const *qname, off_t *sizep, int type, if (lseek (fd, (off_t) (offset + soff + 512), SEEK_SET) != -1) { - soff += 512; + /* Arrange to skip this block. */ + ssize = 512; write_error = true; continue; }