diff options
author | Denys Vlasenko | 2017-07-29 01:20:53 +0200 |
---|---|---|
committer | Denys Vlasenko | 2017-07-29 01:20:53 +0200 |
commit | 00a1dbd230a3e0ee2cea84130b7f20d9c9a9cf4e (patch) | |
tree | 65a624322c1234b0e50d19b2124ea1af0c84fffd /shell | |
parent | f128bdbbd7ab14146a45166d20348f7705888353 (diff) | |
download | busybox-00a1dbd230a3e0ee2cea84130b7f20d9c9a9cf4e.zip busybox-00a1dbd230a3e0ee2cea84130b7f20d9c9a9cf4e.tar.gz |
ash: make tryexec(cmd) parameter const char
Fewer casts this way.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/shell/ash.c b/shell/ash.c index f9c78ee..0de81b3 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -7687,7 +7687,7 @@ static int builtinloc = -1; /* index in path of %builtin, or -1 */ static void -tryexec(IF_FEATURE_SH_STANDALONE(int applet_no,) char *cmd, char **argv, char **envp) +tryexec(IF_FEATURE_SH_STANDALONE(int applet_no,) const char *cmd, char **argv, char **envp) { #if ENABLE_FEATURE_SH_STANDALONE if (applet_no >= 0) { @@ -7713,7 +7713,7 @@ tryexec(IF_FEATURE_SH_STANDALONE(int applet_no,) char *cmd, char **argv, char ** #else execve(cmd, argv, envp); #endif - if (cmd != (char*) bb_busybox_exec_path && errno == ENOEXEC) { + if (cmd != bb_busybox_exec_path && errno == ENOEXEC) { /* Run "cmd" as a shell script: * http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html * "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 ** * message and exit code 126. For one, this prevents attempts * to interpret foreign ELF binaries as shell scripts. */ - argv[0] = cmd; - cmd = (char*) bb_busybox_exec_path; + argv[0] = (char*) cmd; + cmd = bb_busybox_exec_path; /* NB: this is only possible because all callers of shellexec() * ensure that the argv[-1] slot exists! */ |