cmd: misc: Fix return value for sleep command 06/252106/2
authorMarek Szyprowski <m.szyprowski@samsung.com>
Fri, 22 Jan 2021 10:43:35 +0000 (11:43 +0100)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 25 Jan 2021 09:46:20 +0000 (10:46 +0100)
If sleeping has been interrupted, return CMD_RET_FAILURE instead of -1
(CMD_RET_USAGE).

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ieec0d9552770aed06b405fa83fff0bc4f762285f

cmd/misc.c

index 20ab943..e3c7cb3 100644 (file)
@@ -43,7 +43,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);
        }