[PATCH] cmd: misc: Fix return value for the sleep command

Marek Szyprowski m.szyprowski at samsung.com
Fri Jan 22 12:27:31 CET 2021


If sleeping has been interrupted, return CMD_RET_FAILURE instead of -1
(CMD_RET_USAGE).

Signed-off-by: Marek Szyprowski <m.szyprowski at samsung.com>
---
 cmd/sleep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/sleep.c b/cmd/sleep.c
index f0c78a8efb..1fff400c79 100644
--- a/cmd/sleep.c
+++ b/cmd/sleep.c
@@ -40,7 +40,7 @@ static int do_sleep(struct cmd_tbl *cmdtp, int flag, int argc,
 
 	while (get_timer(start) < delay) {
 		if (ctrlc())
-			return (-1);
+			return CMD_RET_FAILURE;
 
 		udelay(100);
 	}
-- 
2.17.1



More information about the U-Boot mailing list