summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Azarov <avm@intermediate-node.net>2025-01-02 12:00:28 +0100
committerVladimir Azarov <avm@intermediate-node.net>2025-01-02 12:00:28 +0100
commitb598e9aaf8e6d41311bab9df147046206bfdef26 (patch)
tree4c8f8dac6263393cae0e8407b4c360794bdf0387
parent06e5eea08d5c06fcca00a469608b288696ae81d1 (diff)
Fix shell pathHEADmaster
-rw-r--r--Makefile5
-rw-r--r--tools/musl-make.c8
2 files changed, 7 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index adaf1a6..93c71ad 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@
CC = gcc
AR = ar
-CFLAGS = -g
+CFLAGS = -g -O3
arch = x86_64
@@ -118,8 +118,7 @@ libc.a: $(all_obj)
$(AR) rcs $@ $^
$(DESTDIR)$(bindir)/%: tools/%
- $(install_cmd)
- chmod +x $@
+ install -D -m 755 $< $@
$(DESTDIR)$(libdir)/%: %
$(install_cmd)
diff --git a/tools/musl-make.c b/tools/musl-make.c
index 33cc117..054c1b8 100644
--- a/tools/musl-make.c
+++ b/tools/musl-make.c
@@ -1166,7 +1166,7 @@ static void expand_shell(struct eval_aux *aux, struct eprofile *prof)
if (pid == -1)
syscall_error("fork");
if (pid == 0) {
- char *argv[] = { "/bin/dash", "-c", arg.start, NULL };
+ char *argv[] = { "/bin/sh", "-c", arg.start, NULL };
if (dup2(pipefds[1], 1) == -1)
syscall_error("dup2");
close(pipefds[1]);
@@ -2139,8 +2139,10 @@ static void parse(struct world *world)
static int is_assignment(char *arg, char **equal_sign)
{
char *tmp = strchr(arg, '=');
- if (tmp == NULL)
+ if (tmp == NULL) {
+ *equal_sign = NULL;
return 0;
+ }
*equal_sign = tmp;
return 1;
}
@@ -2401,7 +2403,7 @@ static struct rule_body *find_body(struct world *world,
struct str *target, int depth)
{
int i;
- struct rule_body *tmp;
+ struct rule_body *tmp = NULL;
/*printf("FB: %S\n", target);*/
if (rtable_find(&world->rtable, target, &tmp) == 1)
return tmp;