Source-Changes-HG archive

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

[src/trunk]: src/bin/sh DEBUG and white space changes only. Convert TRACE()...



details:   https://anonhg.NetBSD.org/src/rev/037e893b9184
branches:  trunk
changeset: 825244:037e893b9184
user:      kre <kre%NetBSD.org@localhost>
date:      Wed Jul 05 19:47:11 2017 +0000

description:
DEBUG and white space changes only.   Convert TRACE() calls for DEBUg mode
to the new style.   NFC (when not debugging sh).

diffstat:

 bin/sh/trap.c |  18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diffs (65 lines):

diff -r 7667d21d50c5 -r 037e893b9184 bin/sh/trap.c
--- a/bin/sh/trap.c     Wed Jul 05 19:30:51 2017 +0000
+++ b/bin/sh/trap.c     Wed Jul 05 19:47:11 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.40 2017/05/07 15:01:18 kre Exp $    */
+/*     $NetBSD: trap.c,v 1.41 2017/07/05 19:47:11 kre Exp $    */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)trap.c     8.5 (Berkeley) 6/5/95";
 #else
-__RCSID("$NetBSD: trap.c,v 1.40 2017/05/07 15:01:18 kre Exp $");
+__RCSID("$NetBSD: trap.c,v 1.41 2017/07/05 19:47:11 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -484,6 +484,9 @@
 void
 onsig(int signo)
 {
+       CTRACE(DBG_SIG, ("Signal %d, had: pending %d, gotsig[%d]=%d\n",
+           signo, pendingsigs, signo, gotsig[signo]));
+
        signal(signo, onsig);
        if (signo == SIGINT && trap[SIGINT] == NULL) {
                onint();
@@ -518,6 +521,8 @@
                }
                gotsig[i] = 0;
                savestatus=exitstatus;
+               CTRACE(DBG_TRAP|DBG_SIG, ("dotrap %d: \"%s\"\n", i,
+                   trap[i] ? trap[i] : "-NULL-"));
                tr = savestr(trap[i]);          /* trap code may free trap[i] */
                evalstring(tr, 0);
                ckfree(tr);
@@ -566,7 +571,9 @@
        struct jmploc loc1, loc2;
        char *p;
 
-       TRACE(("pid %d, exitshell(%d)\n", getpid(), status));
+       CTRACE(DBG_ERRS|DBG_PROCS|DBG_CMDS|DBG_TRAP,
+           ("pid %d, exitshell(%d)\n", getpid(), status));
+
        if (setjmp(loc1.loc)) {
                goto l1;
        }
@@ -576,13 +583,14 @@
        handler = &loc1;
        if ((p = trap[0]) != NULL && *p != '\0') {
                trap[0] = NULL;
+               VTRACE(DBG_TRAP, ("exit trap: \"%s\"\n", p));
                evalstring(p, 0);
        }
-l1:   handler = &loc2;                 /* probably unnecessary */
+ l1:   handler = &loc2;                        /* probably unnecessary */
        flushall();
 #if JOBS
        setjobctl(0);
 #endif
-l2:   _exit(status);
+ l2:   _exit(status);
        /* NOTREACHED */
 }



Home | Main Index | Thread Index | Old Index