aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/sysinstall/dist.c
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1996-07-13 05:44:51 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1996-07-13 05:44:51 +0000
commita4206522302fe7597be97f1ce6b761276c7e47f6 (patch)
tree2e52132b44fd9ce262cfd1714d59641b81d479ab /usr.sbin/sysinstall/dist.c
parent5cec7fa56a8f6fed6ccc8f7ad04e11a876e22a13 (diff)
downloadsrc-a4206522302fe7597be97f1ce6b761276c7e47f6.tar.gz
src-a4206522302fe7597be97f1ce6b761276c7e47f6.zip
Back out my change for Peter which did transfer timings based on current
chunk rather than distribution - it's just caused the numbers to fluctuate too wildly, sorry Peter! ;-(
Notes
Notes: svn path=/head/; revision=17153
Diffstat (limited to 'usr.sbin/sysinstall/dist.c')
-rw-r--r--usr.sbin/sysinstall/dist.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/sysinstall/dist.c b/usr.sbin/sysinstall/dist.c
index 765f0753725f..24efe3805a21 100644
--- a/usr.sbin/sysinstall/dist.c
+++ b/usr.sbin/sysinstall/dist.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: dist.c,v 1.65 1996/07/10 11:38:27 jkh Exp $
+ * $Id: dist.c,v 1.66 1996/07/12 11:13:58 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -423,17 +423,17 @@ distExtract(char *parent, Distribution *me)
msgDebug("Attempting to extract distribution from %u chunks.\n", numchunks);
total = 0;
+ (void)gettimeofday(&start, (struct timezone *)0);
+
/* We have one or more chunks, go pick them up */
mediaExtractDistBegin(root_bias(me[i].my_dir), &fd2, &zpid, &cpid);
for (chunk = 0; chunk < numchunks; chunk++) {
- int n, chunktotal, retval;
+ int n, retval;
char prompt[80];
snprintf(buf, 512, "%s/%s.%c%c", path, dist, (chunk / 26) + 'a', (chunk % 26) + 'a');
if (isDebug())
msgDebug("trying for piece %d of %d: %s\n", chunk + 1, numchunks, buf);
- chunktotal = 0;
- (void)gettimeofday(&start, (struct timezone *)0);
fd = mediaDevice->get(mediaDevice, buf, FALSE);
if (fd < 0) {
msgConfirm("failed to retreive piece file %s!\n"
@@ -448,7 +448,7 @@ distExtract(char *parent, Distribution *me)
n = read(fd, buf, BUFSIZ);
if (n <= 0)
break;
- total += n, chunktotal += n;
+ total += n;
/* Print statistics about how we're doing */
(void) gettimeofday(&stop, (struct timezone *)0);
@@ -459,8 +459,8 @@ distExtract(char *parent, Distribution *me)
seconds = stop.tv_sec + (stop.tv_usec / 1000000.0);
if (!seconds)
seconds = 1;
- msgInfo("%10d bytes read from %s dist, chunk %2d of %2d @ %4.1f KB/sec.",
- total, dist, chunk + 1, numchunks, (chunktotal / seconds) / 1024.0);
+ msgInfo("%10d bytes read from %s dist, chunk %2d of %2d @ %.1f KB/sec.",
+ total, dist, chunk + 1, numchunks, (total / seconds) / 1024.0);
retval = write(fd2, buf, n);
if (retval != n) {
mediaDevice->close(mediaDevice, fd);