From 90aa48744a16dcf7ec265a9437004fd3c4d8b526 Mon Sep 17 00:00:00 2001 From: Stelian Pop Date: Fri, 16 Feb 2001 13:38:46 +0000 Subject: [PATCH] Fix a bug in dump where waiting too much when changing tapes causes the volume to be rewritten. --- CHANGES | 9 +++++++-- dump/tape.c | 18 ++++++++++++------ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index f603aca..77efe79 100644 --- a/CHANGES +++ b/CHANGES @@ -1,11 +1,16 @@ -$Id: CHANGES,v 1.101 2001/02/16 10:40:47 stelian Exp $ +$Id: CHANGES,v 1.102 2001/02/16 13:38:46 stelian Exp $ Changes between versions 0.4b21 and 0.4b22 (released ????????????????) ====================================================================== -1. Let dump report the number of blocks dumped per volume. +1. Made dump report the number of blocks dumped per volume. Thanks to Kenneth Porter for the suggestion. +2. Fix a bug in dump where waiting too much at the 'change volumes' + question caused the volume to be rewritten. Thanks to + Graham Reed for reporting the + bug and providing a patch. + Changes between versions 0.4b20 and 0.4b21 (released January 13, 2001) ====================================================================== diff --git a/dump/tape.c b/dump/tape.c index a210ebb..2db739c 100644 --- a/dump/tape.c +++ b/dump/tape.c @@ -41,7 +41,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tape.c,v 1.29 2001/02/16 10:40:48 stelian Exp $"; + "$Id: tape.c,v 1.30 2001/02/16 13:38:47 stelian Exp $"; #endif /* not lint */ #include @@ -315,11 +315,17 @@ mktimeest(time_t tnow) tapesize = blockswritten; deltat = tstart_writing - tnow + (1.0 * (tnow - tstart_writing)) / blockswritten * tapesize; - (void)snprintf(msgbuf, sizeof(msgbuf), - "%3.2f%% done at %ld KB/s, finished in %d:%02d\n", - (blockswritten * 100.0) / tapesize, - (spcl.c_tapea - tapea_volume) / (tnow - tstart_volume), - (int)(deltat / 3600), (int)((deltat % 3600) / 60)); + if (tnow > tstart_volume) + (void)snprintf(msgbuf, sizeof(msgbuf), + "%3.2f%% done at %ld KB/s, finished in %d:%02d\n", + (blockswritten * 100.0) / tapesize, + (spcl.c_tapea - tapea_volume) / (tnow - tstart_volume), + (int)(deltat / 3600), (int)((deltat % 3600) / 60)); + else + (void)snprintf(msgbuf, sizeof(msgbuf), + "%3.2f%% done, finished in %d:%02d\n", + (blockswritten * 100.0) / tapesize, + (int)(deltat / 3600), (int)((deltat % 3600) / 60)); return msgbuf; } -- 2.39.5