cmd: thordown: Fix to show stopped message when interrupted
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Sat, 25 Apr 2020 06:05:34 +0000 (15:05 +0900)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 15 Nov 2021 10:19:26 +0000 (11:19 +0100)
The thordown command can be interrupted by Ctrl-C, and it can be
identified with error value. Fix to show stopped message when
interrupted.

Change-Id: Idfe1a9dc1e168ea20c94d49ada497dc1b66bde52
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
cmd/thordown.c

index 0e7a945998f6fe1aaab97cc57d644652bbc91b07..b829ed4f5f9b5c359cbb76a8aecd6c5392163714 100644 (file)
@@ -65,12 +65,13 @@ int do_thor_down(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 
        ret = thor_init();
        if (ret) {
-               printk("THOR DOWNLOAD failed: %d\n", ret);
-               if (ret == -EINTR)
+               if (ret == -EINTR) {
+                       printk("THOR DOWNLOAD stopped\n");
                        ret = CMD_RET_SUCCESS;
-               else
+               } else {
+                       printk("THOR DOWNLOAD failed: %d\n", ret);
                        ret = CMD_RET_FAILURE;
-
+               }
                goto exit;
        }