diff options
author | Ron Yorston <rmy@pobox.com> | 2024-04-20 16:08:09 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2024-04-20 16:08:09 +0100 |
commit | 356bfacef7da39052d404e2db166996cf7b74d4d (patch) | |
tree | ecfb1fdec1ea3dcd5ff8a1b4010e322404b6e1d8 /miscutils/make.c | |
parent | ec3bd5c462717a6cd1668f536c8aab9d76ea04b0 (diff) | |
download | busybox-w32-356bfacef7da39052d404e2db166996cf7b74d4d.tar.gz busybox-w32-356bfacef7da39052d404e2db166996cf7b74d4d.tar.bz2 busybox-w32-356bfacef7da39052d404e2db166996cf7b74d4d.zip |
make: skip shell -e option when running commands
POSIX says, regarding execution of commands:
The execution line shall then be executed by a shell as if it
were passed as the argument to the system() interface, except
that if errors are not being ignored then the shell -e option
shall also be in effect.
As a non-POSIX extension, skip the use of the -e option. This is
how GNU make and BSD make behave.
(GitHub issue #409)
Diffstat (limited to 'miscutils/make.c')
-rw-r--r-- | miscutils/make.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/miscutils/make.c b/miscutils/make.c index 87f17aad7..970919ddc 100644 --- a/miscutils/make.c +++ b/miscutils/make.c | |||
@@ -2217,7 +2217,7 @@ docmds(struct name *np, struct cmd *cp) | |||
2217 | if (sdomake) { | 2217 | if (sdomake) { |
2218 | // Get the shell to execute it | 2218 | // Get the shell to execute it |
2219 | int status; | 2219 | int status; |
2220 | char *cmd = !signore ? auto_concat("set -e;", q) : q; | 2220 | char *cmd = !signore && posix ? auto_concat("set -e;", q) : q; |
2221 | 2221 | ||
2222 | target = np; | 2222 | target = np; |
2223 | status = system(cmd); | 2223 | status = system(cmd); |
@@ -2233,7 +2233,6 @@ docmds(struct name *np, struct cmd *cp) | |||
2233 | diagnostic("failed to build '%s'", np->n_name); | 2233 | diagnostic("failed to build '%s'", np->n_name); |
2234 | estat |= MAKE_FAILURE; | 2234 | estat |= MAKE_FAILURE; |
2235 | free(command); | 2235 | free(command); |
2236 | free(cmd); | ||
2237 | break; | 2236 | break; |
2238 | } else if (doinclude) { | 2237 | } else if (doinclude) { |
2239 | warning("failed to build '%s'", np->n_name); | 2238 | warning("failed to build '%s'", np->n_name); |