summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/compat.c
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2002-05-22 14:53:18 +0000
committerru <ru@FreeBSD.org>2002-05-22 14:53:18 +0000
commit7d529109a8eef4f08e3bc6a3f4776582eab7765f (patch)
tree1245223cf02990c1b868cae1cdcab7979f1d4f86 /usr.bin/make/compat.c
parent367d0965de6fb8535844d5baf237d0b7f8200647 (diff)
downloadFreeBSD-src-7d529109a8eef4f08e3bc6a3f4776582eab7765f.zip
FreeBSD-src-7d529109a8eef4f08e3bc6a3f4776582eab7765f.tar.gz
Do not run shell from /bin, run it from $PATH.
Bump MAKE_VERSION to 5200205221.
Diffstat (limited to 'usr.bin/make/compat.c')
-rw-r--r--usr.bin/make/compat.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c
index f0d08aa..d50068b 100644
--- a/usr.bin/make/compat.c
+++ b/usr.bin/make/compat.c
@@ -281,7 +281,11 @@ CompatRunCommand (cmdp, gnp)
* -e flag as well as -c if it's supposed to exit when it hits an
* error.
*/
- static char *shargv[4] = { "/bin/sh" };
+#ifndef _PATH_DEFSHELLDIR
+ static char *shargv[4] = { "sh" };
+#else /* _PATH_DEFSHELLDIR */
+ static char *shargv[4] = { _PATH_DEFSHELLDIR"/sh" };
+#endif /* _PATH_DEFSHELLDIR */
shargv[1] = (errCheck ? "-ec" : "-c");
shargv[2] = cmd;
@@ -293,7 +297,11 @@ CompatRunCommand (cmdp, gnp)
* This command must be passed by the shell for other reasons..
* or.. possibly not at all.
*/
- static char *shargv[4] = { "/bin/sh" };
+#ifndef _PATH_DEFSHELLDIR
+ static char *shargv[4] = { "sh" };
+#else /* _PATH_DEFSHELLDIR */
+ static char *shargv[4] = { _PATH_DEFSHELLDIR"/sh" };
+#endif /* _PATH_DEFSHELLDIR */
if (internal == -1) {
/* Command does not need to be executed */
@@ -333,7 +341,7 @@ CompatRunCommand (cmdp, gnp)
(void) write (STDERR_FILENO, strerror(errno), strlen(strerror(errno)));
(void) write (STDERR_FILENO, "\n", 1);
} else {
- (void)execv(av[0], av);
+ (void)execvp(av[0], av);
}
exit(1);
}
OpenPOWER on IntegriCloud