Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/stand/lib improve awaitkey()'s printout for >9...



details:   https://anonhg.NetBSD.org/src/rev/3c150fbb800b
branches:  trunk
changeset: 476251:3c150fbb800b
user:      drochner <drochner%NetBSD.org@localhost>
date:      Fri Sep 10 16:23:55 1999 +0000

description:
improve awaitkey()'s printout for >9 seconds

diffstat:

 sys/arch/i386/stand/lib/pcio.c |  15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r f975ba46724d -r 3c150fbb800b sys/arch/i386/stand/lib/pcio.c
--- a/sys/arch/i386/stand/lib/pcio.c    Fri Sep 10 16:20:22 1999 +0000
+++ b/sys/arch/i386/stand/lib/pcio.c    Fri Sep 10 16:23:55 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pcio.c,v 1.9 1999/04/14 11:17:05 drochner Exp $         */
+/*     $NetBSD: pcio.c,v 1.10 1999/09/10 16:23:55 drochner Exp $        */
 
 /*
  * Copyright (c) 1996, 1997
@@ -302,8 +302,17 @@
        i = timeout * POLL_FREQ;
 
        while (i) {
-               if (tell && (i % POLL_FREQ) == 0)
-                       printf("%d\b", i/POLL_FREQ);
+               if (tell && (i % POLL_FREQ) == 0) {
+                       char numbuf[20];
+                       int len, j;
+
+                       sprintf(numbuf, "%d ", i/POLL_FREQ);
+                       len = strlen(numbuf);
+                       for (j = 0; j < len; j++)
+                               numbuf[len + j] = '\b';
+                       numbuf[len + j] = '\0';
+                       printf(numbuf);
+               }
                if (iskey()) {
                        /* flush input buffer */
                        while (iskey())



Home | Main Index | Thread Index | Old Index