9
0
Fork 0

run_command: remove unused flag parameter

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2014-02-27 12:23:29 +01:00
parent 3ea30d9ce8
commit 93578fb233
10 changed files with 13 additions and 15 deletions

View File

@ -47,7 +47,7 @@ static int boot_script(char *path)
globalvar_set_match("linux.bootargs.dyn.", ""); globalvar_set_match("linux.bootargs.dyn.", "");
globalvar_set_match("bootm.", ""); globalvar_set_match("bootm.", "");
ret = run_command(path, 0); ret = run_command(path);
if (ret) { if (ret) {
printf("Running %s failed\n", path); printf("Running %s failed\n", path);
goto out; goto out;

View File

@ -39,7 +39,7 @@ static int do_exec(int argc, char *argv[])
if (!script) if (!script)
return 1; return 1;
if (run_command (script, 0) == -1) if (run_command(script) == -1)
goto out; goto out;
free(script); free(script);
} }

View File

@ -68,7 +68,7 @@ static int do_login(int argc, char *argv[])
if (passwd_len < 0) { if (passwd_len < 0) {
console_allow_input(false); console_allow_input(false);
run_command(timeout_cmd, 0); run_command(timeout_cmd);
} }
if (check_passwd(passwd, passwd_len)) if (check_passwd(passwd, passwd_len))

View File

@ -27,7 +27,7 @@ static int do_time(int argc, char *argv[])
start = get_time_ns(); start = get_time_ns();
run_command(buf, 0); run_command(buf);
end = get_time_ns(); end = get_time_ns();

View File

@ -1824,7 +1824,7 @@ static char * make_string(char ** inp)
return str; return str;
} }
int run_command (const char *cmd, int flag) int run_command(const char *cmd)
{ {
struct p_context ctx; struct p_context ctx;
int ret; int ret;

View File

@ -468,7 +468,7 @@ static void menu_action_command(struct menu *m, struct menu_entry *me)
if (!s) if (!s)
s = e->command; s = e->command;
ret = run_command (s, 0); ret = run_command(s);
if (ret < 0) if (ret < 0)
udelay(1000000); udelay(1000000);

View File

@ -176,7 +176,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 run_command(const char *cmd)
{ {
char cmdbuf[CONFIG_CBSIZE]; /* working copy of cmd */ char cmdbuf[CONFIG_CBSIZE]; /* working copy of cmd */
char *token; /* start of token in cmdbuf */ char *token; /* start of token in cmdbuf */
@ -265,18 +265,17 @@ int run_shell(void)
static char lastcommand[CONFIG_CBSIZE] = { 0, }; static char lastcommand[CONFIG_CBSIZE] = { 0, };
int len; int len;
int rc = 1; int rc = 1;
int flag;
for (;;) { for (;;) {
len = readline (CONFIG_PROMPT, console_buffer, CONFIG_CBSIZE); len = readline (CONFIG_PROMPT, console_buffer, CONFIG_CBSIZE);
flag = 0; /* assume no special flags for now */
if (len > 0) if (len > 0)
strcpy (lastcommand, console_buffer); strcpy (lastcommand, console_buffer);
if (len == -1) if (len == -1)
puts ("<INTERRUPT>\n"); puts ("<INTERRUPT>\n");
else else
rc = run_command (lastcommand, flag); rc = run_command(lastcommand);
if (rc <= 0) { if (rc <= 0) {
/* invalid command or not repeatable, forget it */ /* invalid command or not repeatable, forget it */

View File

@ -137,11 +137,11 @@ void __noreturn start_barebox(void)
pr_info("running /env/bin/init...\n"); pr_info("running /env/bin/init...\n");
if (!stat("/env/bin/init", &s)) { if (!stat("/env/bin/init", &s)) {
run_command("source /env/bin/init", 0); run_command("source /env/bin/init");
} else { } else {
pr_err("/env/bin/init not found\n"); pr_err("/env/bin/init not found\n");
if (IS_ENABLED(CONFIG_CMD_LOGIN)) if (IS_ENABLED(CONFIG_CMD_LOGIN))
while(run_command("login -t 0", 0)); while(run_command("login -t 0"));
} }
} }

View File

@ -434,7 +434,7 @@ static void automount_mount(const char *path, int instat)
setenv("automount_path", am->path); setenv("automount_path", am->path);
export("automount_path"); export("automount_path");
ret = run_command(am->cmd, 0); ret = run_command(am->cmd);
setenv("automount_path", NULL); setenv("automount_path", NULL);
if (ret) if (ret)

View File

@ -92,8 +92,7 @@ void __noreturn panic(const char *fmt, ...);
char *size_human_readable(unsigned long long size); char *size_human_readable(unsigned long long size);
/* common/main.c */ int run_command(const char *cmd);
int run_command (const char *cmd, int flag);
int readline (const char *prompt, char *buf, int len); int readline (const char *prompt, char *buf, int len);
/* common/memsize.c */ /* common/memsize.c */