Get all tests passing on NetBSD

This commit is contained in:
Justine Tunney 2021-02-05 09:44:54 -08:00
parent 23ae9dfceb
commit b2cd58a322
41 changed files with 202 additions and 655 deletions

View file

@ -32,9 +32,11 @@ int sys_execve(const char *prog, char *const argv[], char *const envp[]) {
for (i = 0; argv[i];) ++i;
shargs = alloca((i + 2) * sizeof(char *));
memcpy(shargs + 2, argv + 1, i * sizeof(char *));
shargs[0] = !IsFreebsd() ? _PATH_BSHELL
: firstnonnull(commandv("bash", alloca(PATH_MAX)),
_PATH_BSHELL);
if (IsFreebsd() || IsNetbsd()) {
shargs[0] = firstnonnull(commandv("bash", alloca(PATH_MAX)), _PATH_BSHELL);
} else {
shargs[0] = _PATH_BSHELL;
}
shargs[1] = prog;
return __sys_execve(shargs[0], shargs, envp);
}