* [PATCH] ShellPkg/TftpDynamicCommand: Return proper status
@ 2019-01-23 18:26 Vladimir Olovyannikov
2019-01-25 5:08 ` Li, Songpeng
0 siblings, 1 reply; 3+ messages in thread
From: Vladimir Olovyannikov @ 2019-01-23 18:26 UTC (permalink / raw)
To: Jaben Carsey, Ray Ni, edk2-devel; +Cc: Vladimir Olovyannikov
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ShellPkg/TftpDynamicCommand: Return proper status
2019-01-23 18:26 [PATCH] ShellPkg/TftpDynamicCommand: Return proper status Vladimir Olovyannikov
@ 2019-01-25 5:08 ` Li, Songpeng
2019-01-25 16:10 ` Carsey, Jaben
0 siblings, 1 reply; 3+ messages in thread
From: Li, Songpeng @ 2019-01-25 5:08 UTC (permalink / raw)
To: Vladimir Olovyannikov, edk2-devel@lists.01.org; +Cc: Carsey, Jaben, Ni, Ray
Reviewed-by: Songpeng Li <songpeng.li@intel.com>
Sorry, the previous email did not include edk2 mailing list.
Best,
Songpeng
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Vladimir Olovyannikov via edk2-devel
> Sent: Thursday, January 24, 2019 2:26 AM
> To: Carsey, Jaben <jaben.carsey@intel.com>; Ni, Ray <ray.ni@intel.com>;
> edk2-devel@lists.01.org
> Cc: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
> Subject: [edk2] [PATCH] ShellPkg/TftpDynamicCommand: Return proper
> status
>
> 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
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ShellPkg/TftpDynamicCommand: Return proper status
2019-01-25 5:08 ` Li, Songpeng
@ 2019-01-25 16:10 ` Carsey, Jaben
0 siblings, 0 replies; 3+ messages in thread
From: Carsey, Jaben @ 2019-01-25 16:10 UTC (permalink / raw)
To: Li, Songpeng, Vladimir Olovyannikov, edk2-devel@lists.01.org
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
And pushed with the BZ added to commit REF.
> -----Original Message-----
> From: Li, Songpeng
> Sent: Thursday, January 24, 2019 9:08 PM
> To: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>; edk2-
> devel@lists.01.org
> Cc: Carsey, Jaben <jaben.carsey@intel.com>; Ni, Ray <ray.ni@intel.com>
> Subject: RE: [edk2] [PATCH] ShellPkg/TftpDynamicCommand: Return proper
> status
> Importance: High
>
> Reviewed-by: Songpeng Li <songpeng.li@intel.com>
>
> Sorry, the previous email did not include edk2 mailing list.
>
> Best,
> Songpeng
>
>
> > -----Original Message-----
> > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> > Vladimir Olovyannikov via edk2-devel
> > Sent: Thursday, January 24, 2019 2:26 AM
> > To: Carsey, Jaben <jaben.carsey@intel.com>; Ni, Ray <ray.ni@intel.com>;
> > edk2-devel@lists.01.org
> > Cc: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
> > Subject: [edk2] [PATCH] ShellPkg/TftpDynamicCommand: Return proper
> > status
> >
> > 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
> >
> > _______________________________________________
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-01-25 16:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-23 18:26 [PATCH] ShellPkg/TftpDynamicCommand: Return proper status Vladimir Olovyannikov
2019-01-25 5:08 ` Li, Songpeng
2019-01-25 16:10 ` Carsey, Jaben
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox