]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Sockets/GetServByName/GetServByName.c
EmbeddedPkg: Extend NvVarStoreFormattedLib LIBRARY_CLASS
[mirror_edk2.git] / AppPkg / Applications / Sockets / GetServByName / GetServByName.c
index d7237d342cda0da8e9a18b96497c36dc9c6c3a46..41deb194b1a5bbacbe677dbbd763cbf4bb9046a9 100644 (file)
@@ -1,17 +1,9 @@
 /** @file\r
   Translate the service name into a port number\r
 \r
-  Copyright (c) 2011, Intel Corporation\r
-  All rights reserved. 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
+  Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 **/\r
-\r
 #include <errno.h>\r
 #include <netdb.h>\r
 #include <string.h>\r
 \r
 #include <sys/socket.h>\r
 \r
-char mBuffer [65536];\r
+char mBuffer[65536];\r
 \r
 \r
-/**\r
-  Translate the service name into a port number\r
+/** Translate the service name into a port number\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
@@ -41,21 +32,15 @@ main (
   IN char **Argv\r
   )\r
 {\r
-  int AppStatus;\r
   int PortNumber;\r
   struct servent * pService;\r
 \r
-  //\r
   //  Determine if the service name is specified\r
-  //\r
-  AppStatus = 0;\r
   if ( 1 == Argc ) {\r
     Print ( L"%a  <service name>\r\n", Argv[0]);\r
   }\r
   else {\r
-    //\r
     //  Translate the service name\r
-    //\r
     pService = getservbyname ( Argv[1], NULL );\r
     if ( NULL == pService ) {\r
       Print ( L"ERROR - service not found, errno: %d\r\n", errno );\r
@@ -68,9 +53,6 @@ main (
               pService->s_proto );\r
     }\r
   }\r
-\r
-  //\r
   //  All done\r
-  //\r
   return errno;\r
 }\r