Hello.
When a file system dump on an old 5.2 installation showed past 100% done
like this:
DUMP: 98.50% done, finished in 0:07
DUMP: 99.39% done, finished in 0:03
DUMP: 100.19% done, finished in 0:00
DUMP: 101.10% done, finished in 0:-5
DUMP: 423953416 tape blocks
I got a bit curious. Looking at the current code, I noticed that the
"finished in" message is printed in two places, in tape.c/statussig() and
in optr.c/timeest(). The version in statussig() prints using
%d and (int) while the other uses %lld and (long long).
In case this is an oversight from the time_t conversion, here's a diff,
which I tried to make similar to changes in optr.c -r1.33 and
tape.c -r1.35.
Regards, Eivind
Index: tape.c
===================================================================
RCS file: /cvs/src/sbin/dump/tape.c,v
retrieving revision 1.38
diff -u -p -r1.38 tape.c
--- tape.c 12 Nov 2013 04:59:02 -0000 1.38
+++ tape.c 14 Feb 2014 08:21:21 -0000
@@ -265,10 +265,11 @@ statussig(int signo)
deltat = tstart_writing - tnow + (1.0 * (tnow - tstart_writing))
/ blockswritten * tapesize;
(void)snprintf(msgbuf, sizeof(msgbuf),
- "dump: %s %3.2f%% done at %lld KB/s, finished in %d:%02d\n",
+ "dump: %s %3.2f%% done at %lld KB/s, finished in %lld:%02lld\n",
tape, (blockswritten * 100.0) / tapesize,
(spcl.c_tapea - tapea_volume) / (tnow - tstart_volume),
- (int)(deltat / 3600), (int)((deltat % 3600) / 60));
+ (long long)(deltat / 3600),
+ ((long long)deltat % 3600) / 60);
write(STDERR_FILENO, msgbuf, strlen(msgbuf));
errno = save_errno;
}