Переглянути джерело

dont shadow the socket() function

Mike Frysinger 18 роки тому
батько
коміт
133a5a43e9
2 змінених файлів з 6 додано та 6 видалено
  1. 3 3
      libc/inet/rpc/pm_getmaps.c
  2. 3 3
      libc/inet/rpc/pm_getport.c

+ 3 - 3
libc/inet/rpc/pm_getmaps.c

@@ -62,7 +62,7 @@ struct pmaplist *
 pmap_getmaps (struct sockaddr_in *address)
 {
   struct pmaplist *head = (struct pmaplist *) NULL;
-  int socket = -1;
+  int _socket = -1;
   struct timeval minutetimeout;
   CLIENT *client;
 
@@ -72,7 +72,7 @@ pmap_getmaps (struct sockaddr_in *address)
 
   /* Don't need a reserved port to get ports from the portmapper.  */
   client = clnttcp_create (address, PMAPPROG,
-			   PMAPVERS, &socket, 50, 500);
+			   PMAPVERS, &_socket, 50, 500);
   if (client != (CLIENT *) NULL)
     {
       if (CLNT_CALL (client, PMAPPROC_DUMP, (xdrproc_t)xdr_void, NULL,
@@ -83,7 +83,7 @@ pmap_getmaps (struct sockaddr_in *address)
 	}
       CLNT_DESTROY (client);
     }
-  /* (void)__close(socket); CLNT_DESTROY already closed it */
+  /* (void)__close(_socket); CLNT_DESTROY already closed it */
   address->sin_port = 0;
   return head;
 }

+ 3 - 3
libc/inet/rpc/pm_getport.c

@@ -68,13 +68,13 @@ pmap_getport (address, program, version, protocol)
      u_int protocol;
 {
   u_short port = 0;
-  int socket = -1;
+  int _socket = -1;
   CLIENT *client;
   struct pmap parms;
 
   address->sin_port = htons (PMAPPORT);
   client = clntudp_bufcreate (address, PMAPPROG,
-	      PMAPVERS, timeout, &socket, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE);
+	      PMAPVERS, timeout, &_socket, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE);
   if (client != (CLIENT *) NULL)
     {
       struct rpc_createerr *ce = &get_rpc_createerr ();
@@ -95,7 +95,7 @@ pmap_getport (address, program, version, protocol)
 	}
       CLNT_DESTROY (client);
     }
-  /* (void)__close(socket); CLNT_DESTROY already closed it */
+  /* (void)__close(_socket); CLNT_DESTROY already closed it */
   address->sin_port = 0;
   return port;
 }