X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=dump%2Foptr.c;h=b18643702f90af4737f3c45f2b3ba75e2b111ad2;hb=fa7fb4174752ee1b573c537624d531a8ddddcdd9;hp=99d7295cbb04ae5470ffcc5abb47dce027dc5199;hpb=109e9e1d1a904627eeae4d519a0f694795b2892c;p=dump.git diff --git a/dump/optr.c b/dump/optr.c index 99d7295..b186437 100644 --- a/dump/optr.c +++ b/dump/optr.c @@ -41,9 +41,10 @@ #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.18 2000/12/21 11:14:54 stelian Exp $"; #endif /* not lint */ +#include #include #include #include @@ -322,7 +323,7 @@ time_t tschedule = 0; void timeest(void) { - time_t tnow, deltat; + time_t tnow; #ifdef __linux__ (void) time4(&tnow); @@ -330,17 +331,13 @@ timeest(void) (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); + } } }