| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: compat.c,v 1.171 2020/10/31 11:54:33 rillig Exp $ */ | | 1 | /* $NetBSD: compat.c,v 1.172 2020/10/31 18:20:00 rillig Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. | | 4 | * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to Berkeley by | | 7 | * This code is derived from software contributed to Berkeley by |
8 | * Adam de Boor. | | 8 | * Adam de Boor. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -86,27 +86,27 @@ | | | @@ -86,27 +86,27 @@ |
86 | #include <sys/stat.h> | | 86 | #include <sys/stat.h> |
87 | #include <sys/wait.h> | | 87 | #include <sys/wait.h> |
88 | | | 88 | |
89 | #include <errno.h> | | 89 | #include <errno.h> |
90 | #include <signal.h> | | 90 | #include <signal.h> |
91 | | | 91 | |
92 | #include "make.h" | | 92 | #include "make.h" |
93 | #include "dir.h" | | 93 | #include "dir.h" |
94 | #include "job.h" | | 94 | #include "job.h" |
95 | #include "metachar.h" | | 95 | #include "metachar.h" |
96 | #include "pathnames.h" | | 96 | #include "pathnames.h" |
97 | | | 97 | |
98 | /* "@(#)compat.c 8.2 (Berkeley) 3/19/94" */ | | 98 | /* "@(#)compat.c 8.2 (Berkeley) 3/19/94" */ |
99 | MAKE_RCSID("$NetBSD: compat.c,v 1.171 2020/10/31 11:54:33 rillig Exp $"); | | 99 | MAKE_RCSID("$NetBSD: compat.c,v 1.172 2020/10/31 18:20:00 rillig Exp $"); |
100 | | | 100 | |
101 | static GNode *curTarg = NULL; | | 101 | static GNode *curTarg = NULL; |
102 | static pid_t compatChild; | | 102 | static pid_t compatChild; |
103 | static int compatSigno; | | 103 | static int compatSigno; |
104 | | | 104 | |
105 | /* | | 105 | /* |
106 | * CompatDeleteTarget -- delete a failed, interrupted, or otherwise | | 106 | * CompatDeleteTarget -- delete a failed, interrupted, or otherwise |
107 | * duffed target if not inhibited by .PRECIOUS. | | 107 | * duffed target if not inhibited by .PRECIOUS. |
108 | */ | | 108 | */ |
109 | static void | | 109 | static void |
110 | CompatDeleteTarget(GNode *gn) | | 110 | CompatDeleteTarget(GNode *gn) |
111 | { | | 111 | { |
112 | if (gn != NULL && !Targ_Precious(gn)) { | | 112 | if (gn != NULL && !Targ_Precious(gn)) { |
| @@ -257,27 +257,27 @@ Compat_RunCommand(const char *cmdp, GNod | | | @@ -257,27 +257,27 @@ Compat_RunCommand(const char *cmdp, GNod |
257 | */ | | 257 | */ |
258 | useShell = TRUE; | | 258 | useShell = TRUE; |
259 | #else | | 259 | #else |
260 | /* | | 260 | /* |
261 | * Search for meta characters in the command. If there are no meta | | 261 | * Search for meta characters in the command. If there are no meta |
262 | * characters, there's no need to execute a shell to execute the | | 262 | * characters, there's no need to execute a shell to execute the |
263 | * command. | | 263 | * command. |
264 | * | | 264 | * |
265 | * Additionally variable assignments and empty commands | | 265 | * Additionally variable assignments and empty commands |
266 | * go to the shell. Therefore treat '=' and ':' like shell | | 266 | * go to the shell. Therefore treat '=' and ':' like shell |
267 | * meta characters as documented in make(1). | | 267 | * meta characters as documented in make(1). |
268 | */ | | 268 | */ |
269 | | | 269 | |
270 | useShell = needshell(cmd, FALSE); | | 270 | useShell = needshell(cmd); |
271 | #endif | | 271 | #endif |
272 | | | 272 | |
273 | /* | | 273 | /* |
274 | * Print the command before echoing if we're not supposed to be quiet for | | 274 | * Print the command before echoing if we're not supposed to be quiet for |
275 | * this one. We also print the command if -n given. | | 275 | * this one. We also print the command if -n given. |
276 | */ | | 276 | */ |
277 | if (!silent || NoExecute(gn)) { | | 277 | if (!silent || NoExecute(gn)) { |
278 | printf("%s\n", cmd); | | 278 | printf("%s\n", cmd); |
279 | fflush(stdout); | | 279 | fflush(stdout); |
280 | } | | 280 | } |
281 | | | 281 | |
282 | /* | | 282 | /* |
283 | * If we're not supposed to execute any commands, this is as far as | | 283 | * If we're not supposed to execute any commands, this is as far as |