[if gte mso 9]>

[edk2] [Patch] ShellPkg: Return correct exit-code in "exit" command to caller

Subject: [edk2] [Patch] ShellPkg: Return correct exit-code in "exit" command to caller

From: "Ni, Ruiyu" <ruiyu.ni@intel.com>

To: Olivier Martin <olivier.martin@arm.com>, "Carsey, Jaben" <jaben.carsey@intel.com>

Date: 2014-09-17 17:54:11

Hi Olivier, Jaben,

The check in r15180 caused the shell always return EFI_ABORTED no matter what exit-code user specifies for “exit” command. It’s a critical bug for shell user who does different things upon different exit-codes.

The issue is because the error status was returned in the ExitData. But I think unless Shell spec defines that the exit-code can be got from the ExitData, putting the exit-code in ExitData and always returning EFI_ABORTED doesn’t make sense to the caller.

From the current wording in the shell spec 2.1 (If exiting an instance of the UEFI shell, the value that will be returned to the caller.), caller can get the exit-code from StartImage()’s return status.

 

So I would like to roll back this check in firstly to let “exit” command works as expected. We can further discuss how to fix what the r15180 intended to fix.

The roll back caused some conflicts because some new changes in the same place were made after this check in. So I worked out an almost “clean” roll back patch and hope you can review whether it doesn’t bring new issues.

 

 

Regards,

Ray