From patchwork Fri Aug 21 06:49:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 509376 X-Patchwork-Delegate: joe.hershberger@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3AF59140D15 for ; Fri, 21 Aug 2015 16:50:04 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7F7324B639; Fri, 21 Aug 2015 08:50:00 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5Q4pN2GIctjg; Fri, 21 Aug 2015 08:50:00 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0DB524B62B; Fri, 21 Aug 2015 08:50:00 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 535A04B62B for ; Fri, 21 Aug 2015 08:49:57 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5L7bVfZSRCG7 for ; Fri, 21 Aug 2015 08:49:57 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by theia.denx.de (Postfix) with ESMTPS id 248374B624 for ; Fri, 21 Aug 2015 08:49:53 +0200 (CEST) Received: by wicja10 with SMTP id ja10so7807536wic.1 for ; Thu, 20 Aug 2015 23:49:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=X+YrAZisl9hyQjO9PT0ZRkT0wpgEG5dgPDkxGN420tU=; b=Q06uamTEwNuUEx7zZtSdUIvkFXaOr6EwIzkdsB02V04nIA7pYmSxHPsSXQnmYnmN7V FenHx3oiyeuiOqy8U5X+XaCJsf1z+HGiQSQOznygbfoe5vIl8Qm6hzmJ2g7wiH0gT4Dc eVrg8WnLBHqRuRG8+S6pacGH1RiVVZTqM+l+AjbVvToCK9MRJExfOe/3ndj2lBl0ipm7 lIsCc28pEmtTDTqWW9Wc7TDjKxN47jyKDwxgtkpbdg3ZBkpoHnPnqIsCzS6EjttFE/9H cgVUPsXrngpucTTRh2jk0i3ymDtYdwVmFFlT2PvSEjQFa9uIHIlv4/gY3gYaKixhhR5M XSAw== X-Gm-Message-State: ALoCoQlC9nRpDUUTwlgzYo3kyDNKzBsvaqNh+ejBi6Uq0Kvt5iSGrqPx5cHOM99RqpH0rvMepK46 X-Received: by 10.195.12.76 with SMTP id eo12mr13688715wjd.51.1440139793426; Thu, 20 Aug 2015 23:49:53 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id lz10sm8575529wjb.48.2015.08.20.23.49.52 (version=TLS1_1 cipher=AES128-SHA bits=128/128); Thu, 20 Aug 2015 23:49:52 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de Date: Fri, 21 Aug 2015 08:49:48 +0200 Message-Id: X-Mailer: git-send-email 2.5.0 Cc: Tom Rini , Joe Hershberger Subject: [U-Boot] [PATCH v2] net: Return -EINTR when ctrl+c is pressed X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "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 -EINTR return value when CTRL+C is pressed. Signed-off-by: Michal Simek Reviewed-by: Tom Rini Acked-by: Joe Hershberger --- Changes in v2: - Change patch subject - Change return value from -1 to -EINTR net/net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/net.c b/net/net.c index 67e0ad297cf5..2a6efd85eae2 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; }