]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/EfiSocketLib/UseEfiSocketLib.c
Fixed close for socket to properly release the socket context structure and the handle.
[mirror_edk2.git] / StdLib / EfiSocketLib / UseEfiSocketLib.c
index e44a7204355cf0db2a26b4cdcec0e600118ec219..060598af31e4b6f0684833d2492c372404f777dd 100644 (file)
@@ -68,6 +68,40 @@ CONST EFI_GUID mEslUdp6ServiceGuid __attribute__((weak)) = {
 };\r
 \r
 \r
+/**\r
+  Free the socket resources\r
+\r
+  This releases the socket resources allocated by calling\r
+  EslServiceGetProtocol.\r
+\r
+  This routine is called from the ::close routine in BsdSocketLib\r
+  to release the socket resources.\r
+\r
+  @param [in] pSocketProtocol   Address of an ::EFI_SOCKET_PROTOCOL\r
+                                structure\r
+\r
+  @return       Value for ::errno, zero (0) indicates success.\r
+\r
+ **/\r
+int\r
+EslServiceFreeProtocol (\r
+  IN EFI_SOCKET_PROTOCOL * pSocketProtocol\r
+  )\r
+{\r
+  int RetVal;\r
+\r
+  //\r
+  //  Release the socket resources\r
+  //\r
+  EslSocketFree ( pSocketProtocol, &RetVal );\r
+\r
+  //\r
+  //  Return the operation status\r
+  //\r
+  return RetVal;\r
+}\r
+\r
+\r
 /**\r
   Connect to the EFI socket library\r
 \r