Skip to content

Commit a68e7d0

Browse files
committed
Revert "cmd: exit: Fix return value"
This reverts commit 8c4e3b7. This commit is breaking the 'exit' cmd functionality of quiting a script. Revert it so 'exit' works as it is documented: it accepts no arguments and it always returns 0 (success). Signed-off-by: Hector Palacios <[email protected]>
1 parent 50c76fc commit a68e7d0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cmd/exit.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@
1010
static int do_exit(struct cmd_tbl *cmdtp, int flag, int argc,
1111
char *const argv[])
1212
{
13+
int r;
14+
15+
r = 0;
1316
if (argc > 1)
14-
return dectoul(argv[1], NULL);
17+
r = simple_strtoul(argv[1], NULL, 10);
1518

16-
return 0;
19+
return -r - 2;
1720
}
1821

1922
U_BOOT_CMD(

0 commit comments

Comments
 (0)