Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/systat if you change display types, the "Showing %s, ...



details:   https://anonhg.NetBSD.org/src/rev/9c1dbd3fcd3f
branches:  trunk
changeset: 340121:9c1dbd3fcd3f
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sun Aug 23 18:33:15 2015 +0000

description:
if you change display types, the "Showing %s, refresh every %d seconds."
message is retained, and you can't get rid of it.  since it's dispalyed
in inverse, it feels like there's always an error happening (which is
really what the code has -- the above string is displayed via the error()
function.)  for several types of key press that largely are just "redraw"
operation (space, ^L, etc.), clear the error string as well.

diffstat:

 usr.bin/systat/extern.h   |   3 ++-
 usr.bin/systat/keyboard.c |   6 ++++--
 usr.bin/systat/main.c     |  11 +++++++++--
 3 files changed, 15 insertions(+), 5 deletions(-)

diffs (79 lines):

diff -r 1538667abdaa -r 9c1dbd3fcd3f usr.bin/systat/extern.h
--- a/usr.bin/systat/extern.h   Sun Aug 23 18:28:40 2015 +0000
+++ b/usr.bin/systat/extern.h   Sun Aug 23 18:33:15 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: extern.h,v 1.43 2014/06/03 22:22:41 joerg Exp $        */
+/*     $NetBSD: extern.h,v 1.44 2015/08/23 18:33:15 mrg Exp $  */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -93,6 +93,7 @@
 void    disks_drives(char *);
 void    display(int);
 void    error(const char *, ...) __printflike(1, 2);
+void    clearerror(void);
 void    fetchbufcache(void);
 void    fetchdf(void);
 void    fetchicmp(void);
diff -r 1538667abdaa -r 9c1dbd3fcd3f usr.bin/systat/keyboard.c
--- a/usr.bin/systat/keyboard.c Sun Aug 23 18:28:40 2015 +0000
+++ b/usr.bin/systat/keyboard.c Sun Aug 23 18:33:15 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: keyboard.c,v 1.25 2013/10/14 22:23:22 bad Exp $        */
+/*     $NetBSD: keyboard.c,v 1.26 2015/08/23 18:33:15 mrg Exp $        */
 
 /*-
  * Copyright (c) 1980, 1992, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)keyboard.c 8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: keyboard.c,v 1.25 2013/10/14 22:23:22 bad Exp $");
+__RCSID("$NetBSD: keyboard.c,v 1.26 2015/08/23 18:33:15 mrg Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -94,9 +94,11 @@
                                    case '\n':
                                    case '\r':
                                    case ' ':
+                                       clearerror();
                                        display(0);
                                        break;
                                    case CTRL('l'):
+                                       clearerror();
                                        wrefresh(curscr);
                                        break;
                                    case CTRL('g'):
diff -r 1538667abdaa -r 9c1dbd3fcd3f usr.bin/systat/main.c
--- a/usr.bin/systat/main.c     Sun Aug 23 18:28:40 2015 +0000
+++ b/usr.bin/systat/main.c     Sun Aug 23 18:33:15 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.48 2014/06/03 22:22:41 joerg Exp $  */
+/*     $NetBSD: main.c,v 1.49 2015/08/23 18:33:15 mrg Exp $    */
 
 /*-
  * Copyright (c) 1980, 1992, 1993
@@ -36,7 +36,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c     8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: main.c,v 1.48 2014/06/03 22:22:41 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.49 2015/08/23 18:33:15 mrg Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -383,6 +383,13 @@
 }
 
 void
+clearerror(void)
+{
+
+       error("%s", "");
+}
+
+void
 nlisterr(struct nlist name_list[])
 {
        int i, n;



Home | Main Index | Thread Index | Old Index