public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Michal Simek <monstr@monstr.eu>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] net: Return -1 when ctrl+c is pressed
Date: Thu, 20 Aug 2015 14:15:27 +0200	[thread overview]
Message-ID: <55D5C4DF.3010906@monstr.eu> (raw)
In-Reply-To: <a4b4d8853d1a7ae4eccc0f7779cb9e880802aff2.1439451971.git.michal.simek@xilinx.com>

On 08/13/2015 09:46 AM, Michal Simek wrote:
> 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;
>  		}
>  
> 

Joe, Tom: Any update on this one?

Thanks,
Michal


-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150820/5ce9b83c/attachment.sig>

  reply	other threads:[~2015-08-20 12:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2015-08-20 16:51   ` Joe Hershberger
2015-08-21  7:37     ` Michal Simek
2015-08-20 16:51   ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55D5C4DF.3010906@monstr.eu \
    --to=monstr@monstr.eu \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox