-$Id: CHANGES,v 1.95 2000/12/05 15:43:48 stelian Exp $
+$Id: CHANGES,v 1.96 2000/12/05 16:31:35 stelian Exp $
Changes between versions 0.4b20 and 0.4b21 (released ?????????????????)
=======================================================================
Thanks to Gabriel Somlo <somlo@cs.colostate.edu> and
bgjenero <bgjenero@sympatico.ca> for reporting the bug.
+5. Added the throughput information in dump's progression
+ messages. Thanks to Andreas Dilger <adilger@turbolinux.com>
+ for the patch.
+
Changes between versions 0.4b19 and 0.4b20 (released November 10, 2000)
=======================================================================
* Stelian Pop <pop@noos.fr>, 1999-2000
* Stelian Pop <pop@noos.fr> - AlcĂ´ve <www.alcove.fr>, 2000
*
- * $Id: dump.h,v 1.16 2000/12/04 15:43:16 stelian Exp $
+ * $Id: dump.h,v 1.17 2000/12/05 16:31:36 stelian Exp $
*/
/*-
void startnewtape __P((int top));
time_t trewind __P((void));
void writerec __P((const void *dp, int isspcl));
+char *mktimeest __P((time_t tnow));
void Exit __P((int status));
void dumpabort __P((int signo));
#ifndef lint
static const char rcsid[] =
- "$Id: optr.c,v 1.16 2000/12/04 15:43:16 stelian Exp $";
+ "$Id: optr.c,v 1.17 2000/12/05 16:31:36 stelian Exp $";
#endif /* not lint */
#include <sys/param.h>
void
timeest(void)
{
- time_t tnow, deltat;
+ time_t tnow;
#ifdef __linux__
(void) time4(&tnow);
(void) time((time_t *) &tnow);
#endif
if (tnow >= tschedule) {
+ char *buf = mktimeest(tnow);
tschedule = tnow + 300;
- if (blockswritten < 500)
- return;
- if (blockswritten > tapesize)
- tapesize = blockswritten;
- deltat = tstart_writing - tnow +
- (1.0 * (tnow - tstart_writing))
- / blockswritten * tapesize;
- msg("%3.2f%% done, finished in %d:%02d\n",
- (blockswritten * 100.0) / tapesize,
- deltat / 3600, (deltat % 3600) / 60);
+ if (buf) {
+ fprintf(stderr, " DUMP: ");
+ fwrite(buf, strlen(buf), 1, stderr);
+ fflush(stderr);
+ }
}
}
#ifndef lint
static const char rcsid[] =
- "$Id: tape.c,v 1.25 2000/12/04 15:43:16 stelian Exp $";
+ "$Id: tape.c,v 1.26 2000/12/05 16:31:36 stelian Exp $";
#endif /* not lint */
#ifdef __linux__
return(tnow);
}
+char *
+mktimeest(time_t tnow)
+{
+ static char msgbuf[128];
+ time_t deltat;
+
+ msgbuf[0] = '\0';
+
+ if (blockswritten < 500)
+ return NULL;
+ if (blockswritten > tapesize)
+ 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));
+
+ return msgbuf;
+}
+
#if defined(SIGINFO)
/*
* statussig --
* information message upon receipt of SIGINFO
- * (derived from optr.c::timeest())
*/
void
statussig(int notused)
{
- time_t tnow, deltat;
- char msgbuf[128];
+ time_t tnow;
int save_errno = errno;
+ char *buf;
- if (blockswritten < 500)
- return;
#ifdef __linux__
(void) time4(&tnow);
#else
(void) time((time_t *) &tnow);
#endif
- if (blockswritten > tapesize)
- 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));
- write(STDERR_FILENO, msgbuf, strlen(msgbuf));
+ buf = mktimeest(tnow);
+ if (buf)
+ write(STDERR_FILENO, buf, strlen(buf));
errno = save_errno;
}
#endif