public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] net: Return -1 when ctrl+c is pressed
@ 2015-08-13  7:46 Michal Simek
  2015-08-20 12:15 ` Michal Simek
  0 siblings, 1 reply; 5+ messages in thread
From: Michal Simek @ 2015-08-13  7:46 UTC (permalink / raw)
  To: u-boot

Current behavior is that if CTRL+C is pressed command returns 0 that was
successful which is not correct behavior.
The easiest test case is "tftpboot 80000 uImage && echo yes"
and press CTRL+C. Then the second command is called which is incorrect.

Error log:
zynq-uboot> tftpb 80000 uImage && echo yes
Gem.e000b000:7 is connected to Gem.e000b000.  Reconnecting to
Gem.e000b000
Gem.e000b000 Waiting for PHY auto negotiation to complete....... done
Using Gem.e000b000 device
TFTP from server 192.168.0.102; our IP address is 192.168.0.101
Filename 'uImage'.
Load address: 0x80000
Loading: ################
Abort
yes
zynq-uboot>

This patch adds -1 return value when CTRL+C is pressed.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

Not sure if -1 is the right error code but I have parsed the code and it
looks like that -1 is standard behavior for CTRL+C. But I am happy to
change this behavior.

---
 net/net.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/net.c b/net/net.c
index 67e0ad297cf5..738a0db8c2ba 100644
--- a/net/net.c
+++ b/net/net.c
@@ -565,6 +565,7 @@ restart:
 			/* include a debug print as well incase the debug
 			   messages are directed to stderr */
 			debug_cond(DEBUG_INT_STATE, "--- net_loop Abort!\n");
+			ret = -1;
 			goto done;
 		}
 
-- 
2.3.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-08-21  7:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-13  7:46 [U-Boot] [PATCH] net: Return -1 when ctrl+c is pressed Michal Simek
2015-08-20 12:15 ` Michal Simek
2015-08-20 16:51   ` Joe Hershberger
2015-08-21  7:37     ` Michal Simek
2015-08-20 16:51   ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox