diff options
author | Simon J. Gerraty <sjg@FreeBSD.org> | 2023-01-28 00:33:01 +0000 |
---|---|---|
committer | Simon J. Gerraty <sjg@FreeBSD.org> | 2023-01-28 00:33:01 +0000 |
commit | 4fde40d9b540ea1a544cb4378a14f2f6da85ca6d (patch) | |
tree | 5847a5d91a2e3435aa75879041548a9ad9860316 /contrib/bmake/compat.c | |
parent | 52f9a2823c64650c773dadf2d47c451e985f8389 (diff) | |
parent | 2e36ab236364fa38c564f586c46cb9182ce8fd14 (diff) | |
download | src-4fde40d9b540ea1a544cb4378a14f2f6da85ca6d.tar.gz src-4fde40d9b540ea1a544cb4378a14f2f6da85ca6d.zip |
Diffstat (limited to 'contrib/bmake/compat.c')
-rw-r--r-- | contrib/bmake/compat.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/contrib/bmake/compat.c b/contrib/bmake/compat.c index b1996b91af6d..13063d8abd7e 100644 --- a/contrib/bmake/compat.c +++ b/contrib/bmake/compat.c @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.240 2022/05/07 17:49:47 rillig Exp $ */ +/* $NetBSD: compat.c,v 1.244 2023/01/17 21:35:19 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -94,15 +94,15 @@ #include "pathnames.h" /* "@(#)compat.c 8.2 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: compat.c,v 1.240 2022/05/07 17:49:47 rillig Exp $"); +MAKE_RCSID("$NetBSD: compat.c,v 1.244 2023/01/17 21:35:19 christos Exp $"); static GNode *curTarg = NULL; static pid_t compatChild; static int compatSigno; /* - * CompatDeleteTarget -- delete the file of a failed, interrupted, or - * otherwise duffed target if not inhibited by .PRECIOUS. + * Delete the file of a failed, interrupted, or otherwise duffed target, + * unless inhibited by .PRECIOUS. */ static void CompatDeleteTarget(GNode *gn) @@ -110,7 +110,7 @@ CompatDeleteTarget(GNode *gn) if (gn != NULL && !GNode_IsPrecious(gn)) { const char *file = GNode_VarTarget(gn); - if (!opts.noExecute && unlink_file(file)) { + if (!opts.noExecute && unlink_file(file) == 0) { Error("*** %s removed", file); } } @@ -283,7 +283,8 @@ Compat_RunCommand(const char *cmdp, GNode *gn, StringListNode *ln) doIt = true; if (shellName == NULL) /* we came here from jobs */ Shell_Init(); - } else + } else if (!ch_isspace(*cmd)) + /* Ignore whitespace for compatibility with gnu make */ break; cmd++; } @@ -573,7 +574,7 @@ MakeUnmade(GNode *gn, GNode *pgn) * to tell him/her "yes". */ DEBUG0(MAKE, "out-of-date.\n"); - if (opts.query) + if (opts.query && gn != Targ_GetEndNode()) exit(1); /* |