Skip to contentSkip to conversation

cmd: misc: Fix return value for the sleep command

PATCH New Marek Szyprowski 4 participants 4 messages Jan 22, 2021 – Jan 28, 2021 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CGME20210122112739eucas1p1ae7fa48eea75d2bf85f132f05eeb229b@eucas1p1.samsung.com

#1 lore raw

PATCH 1/1 cmd: misc: Fix return value for the sleep command

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

---
 cmd/sleep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
cmd/sleep.c +1 -1
index f0c78a8efb..1fff400c79 100644
@@ -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);
 	}
Signature · 1 line
2.17.1
#3 lore raw

PATCH 1/1 cmd: misc: Fix return value for the sleep command

In reply to Marek Szyprowski
Quoted 4 lines · Marek Szyprowski

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

Best Regards,
Jaehoon Chung

Quoted 18 lines
---
 cmd/sleep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
cmd/sleep.c +1 -1
index f0c78a8efb..1fff400c79 100644
@@ -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);
 	}
#4 lore raw

PATCH 1/1 cmd: misc: Fix return value for the sleep command

In reply to Marek Szyprowski
Quoted 6 lines · Marek Szyprowski

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

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210128/066193f3/attachment.sig>