]> git.wh0rd.org - dump.git/commitdiff
Fix a bug where dump miscalculates the tape size based on -d/-s
authorStelian Pop <stelian@popies.net>
Wed, 2 Mar 2005 08:46:54 +0000 (08:46 +0000)
committerStelian Pop <stelian@popies.net>
Wed, 2 Mar 2005 08:46:54 +0000 (08:46 +0000)
CHANGES
dump/tape.c

diff --git a/CHANGES b/CHANGES
index 40e3dc1a7be77b29bd3541476b71d332447bcfd5..b57c960882951f8c8021c697c647d270b6af85eb 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,4 @@
-$Id: CHANGES,v 1.271 2005/01/25 13:33:41 stelian Exp $
+$Id: CHANGES,v 1.272 2005/03/02 08:46:54 stelian Exp $
 
 Changes between versions 0.4b39 and 0.4b40 (released ????????????????)
 ======================================================================
@@ -15,6 +15,11 @@ Changes between versions 0.4b39 and 0.4b40 (released ????????????????)
        Thanks to Kenneth Porter <shiva@sewingwitch.com> for the bug
        report.
 
+3.     Fixed a bug in dump where the tape size was miscalculated when
+       the user used -d/-s to specify the tape characteristics. Thanks
+       to Philip Goisman <goisman@physics.arizona.edu> for reporting
+       the bug.
+
 Changes between versions 0.4b38 and 0.4b39 (released January 21, 2005)
 ======================================================================
 
index 6f829f88802083d8992b5ffd50462489c9298909..89f630d278ea3484c4ac8aa8054575a81bcdc7a6 100644 (file)
@@ -37,7 +37,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: tape.c,v 1.87 2004/11/22 10:32:32 stelian Exp $";
+       "$Id: tape.c,v 1.88 2005/03/02 08:46:55 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -420,6 +420,10 @@ flushtape(void)
 
        int siz = (char *)nextblock - (char *)slp->req;
 
+       /* make sure returned has sane values in case we don't read 
+        * them from the slave in this pass */
+       returned.unclen = returned.clen = writesize;
+
        slp->req[trecno].count = 0;                     /* Sentinel */
 
        if (dump_atomic_write( slp->fd, (char *)slp->req, siz) != siz)
@@ -620,6 +624,10 @@ rollforward(void)
        tslp = &slaves[SLAVES];
        ntb = (union u_spcl *)tslp->tblock[1];
 
+       /* make sure returned has sane values in case we don't read 
+        * them from the slave in this pass */
+       returned.unclen = returned.clen = writesize;
+
        /*
         * Each of the N slaves should have requests that need to
         * be replayed on the next tape.  Use the extra slave buffers