Source-Changes-HG archive

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

[src/trunk]: src/libexec/getty Use siglongjmp to jump out of signal handlers.



details:   https://anonhg.NetBSD.org/src/rev/5ac623b678a9
branches:  trunk
changeset: 789225:5ac623b678a9
user:      dholland <dholland%NetBSD.org@localhost>
date:      Sun Aug 11 05:48:56 2013 +0000

description:
Use siglongjmp to jump out of signal handlers.

diffstat:

 libexec/getty/main.c |  16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diffs (67 lines):

diff -r 0ec4ab83f753 -r 5ac623b678a9 libexec/getty/main.c
--- a/libexec/getty/main.c      Sun Aug 11 05:42:41 2013 +0000
+++ b/libexec/getty/main.c      Sun Aug 11 05:48:56 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.61 2013/08/11 05:42:41 dholland Exp $       */
+/*     $NetBSD: main.c,v 1.62 2013/08/11 05:48:56 dholland Exp $       */
 
 /*-
  * Copyright (c) 1980, 1993
@@ -40,7 +40,7 @@
 #if 0
 static char sccsid[] = "from: @(#)main.c       8.1 (Berkeley) 6/20/93";
 #else
-__RCSID("$NetBSD: main.c,v 1.61 2013/08/11 05:42:41 dholland Exp $");
+__RCSID("$NetBSD: main.c,v 1.62 2013/08/11 05:48:56 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -135,7 +135,7 @@
 
 static void    clearscreen(void);
 
-jmp_buf timeout;
+sigjmp_buf timeout;
 
 static void
 /*ARGSUSED*/
@@ -144,10 +144,10 @@
 
        (void)alarm(0);
        (void)signal(SIGALRM, SIG_DFL);
-       longjmp(timeout, 1);
+       siglongjmp(timeout, 1);
 }
 
-jmp_buf        intrupt;
+sigjmp_buf intrupt;
 
 static void
 /*ARGSUSED*/
@@ -155,7 +155,7 @@
 {
 
        (void)signal(SIGINT, interrupt);
-       longjmp(intrupt, 1);
+       siglongjmp(intrupt, 1);
 }
 
 /*
@@ -357,7 +357,7 @@
                if (IM && *IM)
                        putf(IM);
                oflush();
-               if (setjmp(timeout)) {
+               if (sigsetjmp(timeout, 1)) {
                        tmode.c_ispeed = tmode.c_ospeed = 0;
                        (void)tcsetattr(0, TCSANOW, &tmode);
                        exit(1);
@@ -455,7 +455,7 @@
        /*
         * Interrupt may happen if we use CBREAK mode
         */
-       if (setjmp(intrupt)) {
+       if (sigsetjmp(intrupt, 1)) {
                (void)signal(SIGINT, SIG_IGN);
                return (0);
        }



Home | Main Index | Thread Index | Old Index