diff options
Diffstat (limited to 'trace.c')
-rw-r--r-- | trace.c | 21 |
1 files changed, 6 insertions, 15 deletions
@@ -1,4 +1,4 @@ -/* $NetBSD: trace.c,v 1.15 2020/08/03 20:26:09 rillig Exp $ */ +/* $NetBSD: trace.c,v 1.21 2020/10/31 22:05:56 rillig Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -29,16 +29,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: trace.c,v 1.15 2020/08/03 20:26:09 rillig Exp $"; -#else -#include <sys/cdefs.h> -#ifndef lint -__RCSID("$NetBSD: trace.c,v 1.15 2020/08/03 20:26:09 rillig Exp $"); -#endif /* not lint */ -#endif - /*- * trace.c -- * handle logging of trace events generated by various parts of make. @@ -54,13 +44,12 @@ __RCSID("$NetBSD: trace.c,v 1.15 2020/08/03 20:26:09 rillig Exp $"); #include <sys/time.h> -#include <stdio.h> -#include <unistd.h> - #include "make.h" #include "job.h" #include "trace.h" +MAKE_RCSID("$NetBSD: trace.c,v 1.21 2020/10/31 22:05:56 rillig Exp $"); + static FILE *trfile; static pid_t trpid; const char *trwd; @@ -78,8 +67,10 @@ void Trace_Init(const char *pathname) { if (pathname != NULL) { - char *dontFreeIt; + void *dontFreeIt; trpid = getpid(); + /* XXX: This variable may get overwritten later, which + * would make trwd point to undefined behavior. */ trwd = Var_Value(".CURDIR", VAR_GLOBAL, &dontFreeIt); trfile = fopen(pathname, "a"); |