public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
To: Jaben Carsey <jaben.carsey@intel.com>, Ray Ni <ray.ni@intel.com>,
	edk2-devel@lists.01.org
Cc: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
Subject: [PATCH] ShellPkg/TftpDynamicCommand: Return proper status
Date: Wed, 23 Jan 2019 10:26:15 -0800	[thread overview]
Message-ID: <20190123182615.3184-1-vladimir.olovyannikov@broadcom.com> (raw)

Tftp command always returned "SHELL_NOT_FOUND" which is treated as an
error by callers. Add missing line to clean the ShellStatus on
successful operation. If operation has failed, return the error status
if available.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
---
 ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c b/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
index ba753a279b00..88e3988a554e 100644
--- a/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
+++ b/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
@@ -548,6 +548,8 @@ RunTftp (
       goto NextHandle;
     }
 
+    ShellStatus = SHELL_SUCCESS;
+
     NextHandle:
 
     CloseProtocolAndDestroyServiceChild (
@@ -575,6 +577,10 @@ RunTftp (
     FreePool (Handles);
   }
 
+  if ((ShellStatus != SHELL_SUCCESS) && (EFI_ERROR(Status))) {
+    ShellStatus = Status & ~MAX_BIT;
+  }
+
   return ShellStatus;
 }
 
-- 
2.20.1



             reply	other threads:[~2019-01-23 18:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-23 18:26 Vladimir Olovyannikov [this message]
2019-01-25  5:08 ` [PATCH] ShellPkg/TftpDynamicCommand: Return proper status Li, Songpeng
2019-01-25 16:10   ` Carsey, Jaben

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-list 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=20190123182615.3184-1-vladimir.olovyannikov@broadcom.com \
    --to=devel@edk2.groups.io \
    /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