Jon Peatfield <[EMAIL PROTECTED]> writes:
> However at the end of the loop it still does soff += ssize (the return
> from the write()), which moves us to no longer being block aligned so
> at the 2nd "error", it fails to skip the block and instead errors out.
Thanks for spotting this bug and proposing a patch. Here's an
alternative (slightly simpler) patch. This patch is relative to
coreutils CVS.
2004-06-04 Paul Eggert <[EMAIL PROTECTED]>
* src/shred.c (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
Index: shred.c
===================================================================
RCS file: /home/meyering/coreutils/cu/src/shred.c,v
retrieving revision 1.94
diff -p -u -r1.94 shred.c
--- shred.c 30 May 2004 08:43:35 -0000 1.94
+++ shred.c 4 Jun 2004 07:33:28 -0000
@@ -921,7 +921,7 @@ dopass (int fd, char const *qname, off_t
if (lseek (fd, (off_t) (offset + soff + 512), SEEK_SET)
!= -1)
{
- soff += 512;
+ ssize = 512;
write_error = true;
continue;
}
_______________________________________________
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/bug-coreutils