Rename run_command() to builtin_run_command()

The current run_command() is only one of the parsing options - the other
is hush. We should not call run_command() when the hush parser is being
used. So we rename this function to better explain its purpose.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
Simon Glass 2012-02-14 19:59:19 +00:00 committed by Wolfgang Denk
parent 79714c1e26
commit f47360a74e
9 changed files with 14 additions and 13 deletions

View File

@ -227,7 +227,7 @@ static void kw_sysrst_action(void)
debug("Starting %s process...\n", __FUNCTION__); debug("Starting %s process...\n", __FUNCTION__);
#if !defined(CONFIG_SYS_HUSH_PARSER) #if !defined(CONFIG_SYS_HUSH_PARSER)
ret = run_command (s, 0); ret = builtin_run_command(s, 0);
#else #else
ret = parse_string_outer(s, FLAG_PARSE_SEMICOLON ret = parse_string_outer(s, FLAG_PARSE_SEMICOLON
| FLAG_EXIT_FROM_LOOP); | FLAG_EXIT_FROM_LOOP);

View File

@ -169,7 +169,7 @@ int au_do_update(int i, long sz)
k++; k++;
} }
run_command(addr, 0); builtin_run_command(addr, 0);
return 0; return 0;
} }

View File

@ -110,7 +110,7 @@ int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
* Call run_cmd * Call run_cmd
*/ */
printf("running command at addr 0x%s ...\n", addr); printf("running command at addr 0x%s ...\n", addr);
run_command((char*)la, 0); builtin_run_command((char *)la, 0);
break; break;
default: default:

View File

@ -831,7 +831,7 @@ int do_time(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
*d = '\0'; *d = '\0';
start = get_ticks(); start = get_ticks();
ret = run_command (cmd, 0); ret = builtin_run_command(cmd, 0);
end = get_ticks(); end = get_ticks();
printf("ticks=%ld\n", (ulong)(end - start)); printf("ticks=%ld\n", (ulong)(end - start));

View File

@ -237,7 +237,7 @@ void bedbug_main_loop (unsigned long addr, struct pt_regs *regs)
if (len == -1) if (len == -1)
printf ("<INTERRUPT>\n"); printf ("<INTERRUPT>\n");
else else
rc = run_command (lastcommand, flag); rc = builtin_run_command(lastcommand, flag);
if (rc <= 0) { if (rc <= 0) {
/* invalid command or not repeatable, forget it */ /* invalid command or not repeatable, forget it */

View File

@ -1046,7 +1046,7 @@ int do_bootd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
int rcode = 0; int rcode = 0;
#ifndef CONFIG_SYS_HUSH_PARSER #ifndef CONFIG_SYS_HUSH_PARSER
if (run_command(getenv("bootcmd"), flag) < 0) if (builtin_run_command(getenv("bootcmd"), flag) < 0)
rcode = 1; rcode = 1;
#else #else
if (parse_string_outer(getenv("bootcmd"), if (parse_string_outer(getenv("bootcmd"),

View File

@ -179,7 +179,7 @@ source (ulong addr, const char *fit_uname)
if (*line) { if (*line) {
debug ("** exec: \"%s\"\n", debug ("** exec: \"%s\"\n",
line); line);
if (run_command (line, 0) < 0) { if (builtin_run_command(line, 0) < 0) {
rcode = 1; rcode = 1;
break; break;
} }
@ -189,7 +189,7 @@ source (ulong addr, const char *fit_uname)
++next; ++next;
} }
if (rcode == 0 && *line) if (rcode == 0 && *line)
rcode = (run_command(line, 0) >= 0); rcode = (builtin_run_command(line, 0) >= 0);
} }
#endif #endif
free (cmd); free (cmd);

View File

@ -274,9 +274,10 @@ int run_command2(const char *cmd, int flag)
{ {
#ifndef CONFIG_SYS_HUSH_PARSER #ifndef CONFIG_SYS_HUSH_PARSER
/* /*
* run_command can return 0 or 1 for success, so clean up its result. * builtin_run_command can return 0 or 1 for success, so clean up
* its result.
*/ */
if (run_command(cmd, flag) == -1) if (builtin_run_command(cmd, flag) == -1)
return 1; return 1;
return 0; return 0;
@ -457,7 +458,7 @@ void main_loop (void)
if (len == -1) if (len == -1)
puts ("<INTERRUPT>\n"); puts ("<INTERRUPT>\n");
else else
rc = run_command (lastcommand, flag); rc = builtin_run_command(lastcommand, flag);
if (rc <= 0) { if (rc <= 0) {
/* invalid command or not repeatable, forget it */ /* invalid command or not repeatable, forget it */
@ -1278,7 +1279,7 @@ static void process_macros (const char *input, char *output)
* creates or modifies environment variables (like "bootp" does). * creates or modifies environment variables (like "bootp" does).
*/ */
int run_command (const char *cmd, int flag) int builtin_run_command(const char *cmd, int flag)
{ {
cmd_tbl_t *cmdtp; cmd_tbl_t *cmdtp;
char cmdbuf[CONFIG_SYS_CBSIZE]; /* working copy of cmd */ char cmdbuf[CONFIG_SYS_CBSIZE]; /* working copy of cmd */

View File

@ -260,7 +260,7 @@ int print_buffer (ulong addr, void* data, uint width, uint count, uint linelen);
/* common/main.c */ /* common/main.c */
void main_loop (void); void main_loop (void);
int run_command (const char *cmd, int flag); int builtin_run_command(const char *cmd, int flag);
int run_command2(const char *cmd, int flag); int run_command2(const char *cmd, int flag);
int readline (const char *const prompt); int readline (const char *const prompt);
int readline_into_buffer(const char *const prompt, char *buffer, int readline_into_buffer(const char *const prompt, char *buffer,