summaryrefslogtreecommitdiff
path: root/compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'compat.c')
-rw-r--r--compat.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/compat.c b/compat.c
index 0da929e35b82..7a51a99be4ba 100644
--- a/compat.c
+++ b/compat.c
@@ -1,4 +1,4 @@
-/* $NetBSD: compat.c,v 1.262 2025/01/19 10:57:10 rillig Exp $ */
+/* $NetBSD: compat.c,v 1.267 2025/06/13 03:51:18 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -90,13 +90,16 @@
#include "make.h"
#include "dir.h"
#include "job.h"
+#ifdef USE_META
+# include "meta.h"
+#endif
#include "metachar.h"
#include "pathnames.h"
/* "@(#)compat.c 8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: compat.c,v 1.262 2025/01/19 10:57:10 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.267 2025/06/13 03:51:18 rillig Exp $");
-static GNode *curTarg = NULL;
+static GNode *curTarg;
static pid_t compatChild;
static int compatSigno;
@@ -107,7 +110,7 @@ static int compatSigno;
static void
CompatDeleteTarget(GNode *gn)
{
- if (gn != NULL && !GNode_IsPrecious(gn) &&
+ if (!GNode_IsPrecious(gn) &&
(gn->type & OP_PHONY) == 0) {
const char *file = GNode_VarTarget(gn);
if (!opts.noExecute && unlink_file(file) == 0)
@@ -127,11 +130,9 @@ CompatDeleteTarget(GNode *gn)
static void
CompatInterrupt(int signo)
{
- CompatDeleteTarget(curTarg);
-
- if (curTarg != NULL && !GNode_IsPrecious(curTarg)) {
- /* Run .INTERRUPT only if hit with interrupt signal. */
- if (signo == SIGINT) {
+ if (curTarg != NULL) {
+ CompatDeleteTarget(curTarg);
+ if (signo == SIGINT && !GNode_IsPrecious(curTarg)) {
GNode *gn = Targ_FindNode(".INTERRUPT");
if (gn != NULL)
Compat_Make(gn, gn);
@@ -309,8 +310,6 @@ Compat_RunCommand(const char *cmdp, GNode *gn, StringListNode *ln)
cmd++;
}
- while (ch_isspace(*cmd))
- cmd++;
if (cmd[0] == '\0')
goto register_command;
@@ -337,7 +336,7 @@ Compat_RunCommand(const char *cmdp, GNode *gn, StringListNode *ln)
if (Cmd_Argv(cmd, cmd_len, shargv, 5,
cmd_file, sizeof(cmd_file),
- (errCheck && shellErrFlag != NULL),
+ errCheck && shellErrFlag != NULL,
DEBUG(SHELL)) < 0)
Fatal("cannot run \"%s\"", cmd);
av = shargv;
@@ -356,6 +355,7 @@ Compat_RunCommand(const char *cmdp, GNode *gn, StringListNode *ln)
#endif
Var_ReexportVars(gn);
+ Var_ExportStackTrace(gn->name, cmd);
compatChild = Compat_Spawn(av);
free(mav);
@@ -730,7 +730,7 @@ InitSignals(void)
}
void
-Compat_MakeAll(GNodeList *targs)
+Compat_MakeAll(GNodeList *targets)
{
GNode *errorNode = NULL;
@@ -753,10 +753,10 @@ Compat_MakeAll(GNodeList *targs)
* Expand .USE nodes right now, because they can modify the structure
* of the tree.
*/
- Make_ExpandUse(targs);
+ Make_ExpandUse(targets);
- while (!Lst_IsEmpty(targs)) {
- GNode *gn = Lst_Dequeue(targs);
+ while (!Lst_IsEmpty(targets)) {
+ GNode *gn = Lst_Dequeue(targets);
Compat_Make(gn, gn);
if (gn->made == UPTODATE) {