From: Michal Simek Date: Fri, 21 Aug 2015 06:49:48 +0000 (+0200) Subject: net: Return -EINTR when ctrl+c is pressed X-Git-Tag: v2015.10-rc3~97^2~6 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=19a4fbaaddd6542b46120d786bc375aee1b9e257;p=oweals%2Fu-boot.git net: Return -EINTR when ctrl+c is pressed 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 -EINTR return value when CTRL+C is pressed. Signed-off-by: Michal Simek Reviewed-by: Tom Rini Acked-by: Joe Hershberger --- diff --git a/net/net.c b/net/net.c index 67e0ad297c..2a6efd85ea 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 = -EINTR; goto done; }