summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorpst <pst@FreeBSD.org>1996-09-26 22:12:07 +0000
committerpst <pst@FreeBSD.org>1996-09-26 22:12:07 +0000
commit34bee7304386ede852796728b65f3a5537a2f5b5 (patch)
tree029c35060a8670def9806a52c510aeb336c9ad54 /usr.sbin
parent20036679ece1df18d68d9b0ed5fe331862fce6c8 (diff)
downloadFreeBSD-src-34bee7304386ede852796728b65f3a5537a2f5b5.zip
FreeBSD-src-34bee7304386ede852796728b65f3a5537a2f5b5.tar.gz
Rate limit the "xxx bytes read from" message to a maximum of one per
chunk or one per second, whichever is less. Outputting this message once every couple of K was really crazy on a 9600bps serial console.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/sysinstall/dist.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/usr.sbin/sysinstall/dist.c b/usr.sbin/sysinstall/dist.c
index a6d3845..bc1423e 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.67 1996/07/13 05:44:51 jkh Exp $
+ * $Id: dist.c,v 1.68 1996/08/03 10:10:48 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -428,9 +428,11 @@ distExtract(char *parent, Distribution *me)
/* 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, retval;
+ int n, retval, last_msg;
char prompt[80];
+ last_msg = 0;
+
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);
@@ -459,8 +461,12 @@ 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 @ %.1f KB/sec.",
- total, dist, chunk + 1, numchunks, (total / seconds) / 1024.0);
+
+ if (seconds != last_msg) {
+ last_msg = seconds;
+ 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);
OpenPOWER on IntegriCloud