diff options
| author | blymn <blymn@NetBSD.org> | 2007-05-29 13:20:21 +0000 |
|---|---|---|
| committer | blymn <blymn@NetBSD.org> | 2007-05-29 13:20:21 +0000 |
| commit | eaa84a63c091ad2bdb10d6fcf8fb0ebadfe9799e (patch) | |
| tree | 26a46202ed24e950e25c935f94e976a9603238d6 /lib/libcurses | |
| parent | 82e46da13fa8d1c3865018a6fe54e887f951c784 (diff) | |
Change debug handling, now we write debug out iff CURSES_TRACE_FILE
has been set in the environment, this prevents people using MKDEBUGLIB
getting more than they bargained for.
Tidied up the debug settings in the Makefile to reflect the above change,
we no longer need to have FULL_DEBUG since nothing is written by default.
Diffstat (limited to 'lib/libcurses')
| -rw-r--r-- | lib/libcurses/Makefile | 9 | ||||
| -rw-r--r-- | lib/libcurses/ctrace.c | 18 |
2 files changed, 12 insertions, 15 deletions
diff --git a/lib/libcurses/Makefile b/lib/libcurses/Makefile index 3848f6553cc..2e703c549c6 100644 --- a/lib/libcurses/Makefile +++ b/lib/libcurses/Makefile @@ -1,16 +1,11 @@ -# $NetBSD: Makefile,v 1.53 2007/05/28 15:01:53 blymn Exp $ +# $NetBSD: Makefile,v 1.54 2007/05/29 13:20:21 blymn Exp $ # @(#)Makefile 8.2 (Berkeley) 1/2/94 .include <bsd.own.mk> -CPPFLAGS+=#-DTFILE=\"/dev/ttyp0\" CPPFLAGS+=-I${.CURDIR} -I${NETBSDSRCDIR}/lib/libterm .if defined(DEBUG_CURSES) -CFLAGS+=-g -CPPFLAGS+=-g -.if defined(FULL_DEBUG) -CPPFLAGS+=-DDEBUG -.endif +CPPFLAGS+=-g -DDEBUG .endif .if defined(SMALL) CPPFLAGS+=-DSMALL diff --git a/lib/libcurses/ctrace.c b/lib/libcurses/ctrace.c index d63bf316bab..4a012521952 100644 --- a/lib/libcurses/ctrace.c +++ b/lib/libcurses/ctrace.c @@ -1,4 +1,4 @@ -/* $NetBSD: ctrace.c,v 1.18 2007/01/22 21:14:53 jdc Exp $ */ +/* $NetBSD: ctrace.c,v 1.19 2007/05/29 13:20:21 blymn Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)ctrace.c 8.2 (Berkeley) 10/5/93"; #else -__RCSID("$NetBSD: ctrace.c,v 1.18 2007/01/22 21:14:53 jdc Exp $"); +__RCSID("$NetBSD: ctrace.c,v 1.19 2007/05/29 13:20:21 blymn Exp $"); #endif #endif /* not lint */ @@ -49,10 +49,6 @@ __RCSID("$NetBSD: ctrace.c,v 1.18 2007/01/22 21:14:53 jdc Exp $"); #include "curses.h" #include "curses_private.h" -#ifndef TFILE -#define TFILE "__curses.out" -#endif - static FILE *tracefp = NULL; /* Curses debugging file descriptor. */ static int tracemask; /* Areas of trace output we want. */ @@ -74,9 +70,15 @@ __CTRACE_init() tracemask = (0 - tracemask) ^ __CTRACE_ALL; if (tracemask == 0) return; + tf = getenv("CURSES_TRACE_FILE"); - if (tf == NULL || strcmp( tf, "<none>")) - tracefp = fopen(tf ? tf : TFILE, "w"); + + if ((tf != NULL) && !strcmp( tf, "<none>")) + tf = NULL; + + if (tf != NULL) + tracefp = fopen(tf, "w"); + init_done = 1; __CTRACE(__CTRACE_ALL, "Trace mask: 0x%08x\n", tracemask); } |
