/**\r
Worker routine to close the socket.\r
\r
- @param [in] pSocketProtocol Socket protocol structure address\r
+ @param[in] pSocketProtocol Socket protocol structure address\r
\r
- @param [in] pErrno Address of the errno variable\r
+ @param[in] pErrno Address of the ::errno variable\r
\r
@retval EFI_SUCCESS Successfully closed the socket\r
\r
IN int * pErrno\r
)\r
{\r
- EFI_SERVICE_BINDING_PROTOCOL * pServiceBinding;\r
EFI_STATUS Status;\r
\r
//\r
}\r
if ( !EFI_ERROR ( Status )) {\r
//\r
- // Locate the socket protocol\r
+ // Release the socket resources\r
//\r
- Status = gBS->LocateProtocol ( &gEfiSocketServiceBindingProtocolGuid,\r
- NULL,\r
- (VOID **) &pServiceBinding );\r
- if ( !EFI_ERROR ( Status )) {\r
- //\r
- // Release the handle\r
- //\r
- Status = pServiceBinding->DestroyChild ( pServiceBinding,\r
- pSocketProtocol->SocketHandle );\r
- }\r
- if ( EFI_ERROR ( Status )) {\r
- *pErrno = EIO;\r
- }\r
+ *pErrno = EslServiceFreeProtocol ( pSocketProtocol );\r
}\r
else {\r
DEBUG (( DEBUG_ERROR,\r
/**\r
Close the socket\r
\r
- @param [in] pDescriptor Descriptor address for the file\r
+ The BslSocketClose routine is called indirectly from the close file\r
+ system routine. This routine closes the socket and returns the\r
+ status to the caller.\r
\r
- @returns This routine returns 0 upon success and -1 upon failure.\r
- In the case of failure, errno contains more information.\r
+ @param[in] pDescriptor Descriptor address for the file\r
+\r
+ @return This routine returns 0 upon success and -1 upon failure.\r
+ In the case of failure, ::errno contains more information.\r
\r
**/\r
int\r
+EFIAPI\r
BslSocketClose (\r
struct __filedes * pDescriptor\r
)\r