Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/systat Block alarm signals while displaying -- there...



details:   https://anonhg.NetBSD.org/src/rev/b700d8b993d9
branches:  trunk
changeset: 479751:b700d8b993d9
user:      jwise <jwise%NetBSD.org@localhost>
date:      Mon Dec 20 21:04:41 1999 +0000

description:
Block alarm signals while displaying -- there's no reason to allow recursive
display at all.

diffstat:

 usr.bin/systat/main.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r b15490dae888 -r b700d8b993d9 usr.bin/systat/main.c
--- a/usr.bin/systat/main.c     Mon Dec 20 20:58:08 1999 +0000
+++ b/usr.bin/systat/main.c     Mon Dec 20 21:04:41 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.21 1999/12/20 17:08:52 jwise Exp $  */
+/*     $NetBSD: main.c,v 1.22 1999/12/20 21:04:41 jwise Exp $  */
 
 /*-
  * Copyright (c) 1980, 1992, 1993
@@ -40,7 +40,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c     8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: main.c,v 1.21 1999/12/20 17:08:52 jwise Exp $");
+__RCSID("$NetBSD: main.c,v 1.22 1999/12/20 21:04:41 jwise Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -246,6 +246,11 @@
        int signo;
 {
        int i, j;
+       sigset_t set;
+
+       sigemptyset(&set);
+       sigaddset(&set, SIGALRM);
+       sigprocmask(SIG_BLOCK, &set, NULL);
 
        /* Get the load average over the last minute. */
        (void)getloadavg(avenrun, sizeof(avenrun) / sizeof(avenrun[0]));
@@ -274,6 +279,7 @@
        wrefresh(wnd);
        move(CMDLINE, col);
        refresh();
+       sigprocmask(SIG_UNBLOCK, &set, NULL);
        alarm(naptime);
 }
 



Home | Main Index | Thread Index | Old Index