aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-07-29 01:20:53 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-07-29 01:20:53 +0200
commit00a1dbd230a3e0ee2cea84130b7f20d9c9a9cf4e (patch)
tree65a624322c1234b0e50d19b2124ea1af0c84fffd
parentf128bdbbd7ab14146a45166d20348f7705888353 (diff)
downloadbusybox-w32-00a1dbd230a3e0ee2cea84130b7f20d9c9a9cf4e.tar.gz
busybox-w32-00a1dbd230a3e0ee2cea84130b7f20d9c9a9cf4e.tar.bz2
busybox-w32-00a1dbd230a3e0ee2cea84130b7f20d9c9a9cf4e.zip
ash: make tryexec(cmd) parameter const char
Fewer casts this way. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--shell/ash.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/shell/ash.c b/shell/ash.c
index f9c78ee78..0de81b325 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -7687,7 +7687,7 @@ static int builtinloc = -1; /* index in path of %builtin, or -1 */
7687 7687
7688 7688
7689static void 7689static void
7690tryexec(IF_FEATURE_SH_STANDALONE(int applet_no,) char *cmd, char **argv, char **envp) 7690tryexec(IF_FEATURE_SH_STANDALONE(int applet_no,) const char *cmd, char **argv, char **envp)
7691{ 7691{
7692#if ENABLE_FEATURE_SH_STANDALONE 7692#if ENABLE_FEATURE_SH_STANDALONE
7693 if (applet_no >= 0) { 7693 if (applet_no >= 0) {
@@ -7713,7 +7713,7 @@ tryexec(IF_FEATURE_SH_STANDALONE(int applet_no,) char *cmd, char **argv, char **
7713#else 7713#else
7714 execve(cmd, argv, envp); 7714 execve(cmd, argv, envp);
7715#endif 7715#endif
7716 if (cmd != (char*) bb_busybox_exec_path && errno == ENOEXEC) { 7716 if (cmd != bb_busybox_exec_path && errno == ENOEXEC) {
7717 /* Run "cmd" as a shell script: 7717 /* Run "cmd" as a shell script:
7718 * http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html 7718 * http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html
7719 * "If the execve() function fails with ENOEXEC, the shell 7719 * "If the execve() function fails with ENOEXEC, the shell
@@ -7730,8 +7730,8 @@ tryexec(IF_FEATURE_SH_STANDALONE(int applet_no,) char *cmd, char **argv, char **
7730 * message and exit code 126. For one, this prevents attempts 7730 * message and exit code 126. For one, this prevents attempts
7731 * to interpret foreign ELF binaries as shell scripts. 7731 * to interpret foreign ELF binaries as shell scripts.
7732 */ 7732 */
7733 argv[0] = cmd; 7733 argv[0] = (char*) cmd;
7734 cmd = (char*) bb_busybox_exec_path; 7734 cmd = bb_busybox_exec_path;
7735 /* NB: this is only possible because all callers of shellexec() 7735 /* NB: this is only possible because all callers of shellexec()
7736 * ensure that the argv[-1] slot exists! 7736 * ensure that the argv[-1] slot exists!
7737 */ 7737 */