]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Sockets/GetHostByAddr/GetHostByAddr.c
BaseTools/BinToPcd: Fix Python 2.7.x compatibility issue
[mirror_edk2.git] / AppPkg / Applications / Sockets / GetHostByAddr / GetHostByAddr.c
index 63299a1f9d5d28390979bb83c16595b1a24aa503..c096f43ba1064b6aabb19056af6c16abdedcdba0 100644 (file)
@@ -1,17 +1,15 @@
 /** @file\r
   Translate the port number into a service name\r
 \r
-  Copyright (c) 2011, Intel Corporation\r
-  All rights reserved. This program and the accompanying materials\r
+  Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
   http://opensource.org/licenses/bsd-license.php\r
 \r
   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
 **/\r
-\r
 #include <errno.h>\r
 #include <netdb.h>\r
 #include <stdio.h>\r
@@ -19,8 +17,8 @@
 #include <Uefi.h>\r
 #include <unistd.h>\r
 \r
-#include <arpa\nameser.h>\r
-#include <arpa\nameser_compat.h>\r
+#include <arpa/nameser.h>\r
+#include <arpa/nameser_compat.h>\r
 \r
 #include <Library/DebugLib.h>\r
 #include <Library/UefiLib.h>\r
@@ -30,8 +28,8 @@
 /**\r
   Translate the IP address into a host name\r
 \r
-  @param [in] Argc  The number of arguments\r
-  @param [in] Argv  The argument value array\r
+  @param[in] Argc   The number of arguments\r
+  @param[in] Argv   The argument value array\r
 \r
   @retval  0        The application exited normally.\r
   @retval  Other    An error occurred.\r
@@ -73,9 +71,9 @@ main (
     IpAddress[1] = (UINT8)RemoteAddress[1];\r
     IpAddress[2] = (UINT8)RemoteAddress[2];\r
     IpAddress[3] = (UINT8)RemoteAddress[3];\r
-    pHost = gethostbyaddr ( &IpAddress[0], INADDRSZ, AF_INET );\r
+    pHost = gethostbyaddr ( (const char *)&IpAddress[0], INADDRSZ, AF_INET );\r
     if ( NULL == pHost ) {\r
-      Print ( L"ERROR - host not found, errno: %d\r\n", errno );\r
+      Print ( L"ERROR - host not found, h_errno: %d\r\n", h_errno );\r
     }\r
     else {\r
       pIpAddress = (UINT8 *)pHost->h_addr_list[ 0 ];\r