]> The Tcpdump Group git mirrors - libpcap/commitdiff
Don't call a socket variable "socket".
authorGuy Harris <[email protected]>
Mon, 20 Mar 2017 19:25:08 +0000 (12:25 -0700)
committerGuy Harris <[email protected]>
Mon, 20 Mar 2017 19:25:08 +0000 (12:25 -0700)
That collides with the create-a-socket function socket().

sockutils.c
sockutils.h

index a19f1081e0883718c48c1ee42d88b2e0dc9bf26f..b6a7299c87f078fddf60aefba009949b31f92060 100644 (file)
@@ -554,7 +554,7 @@ int sock_initaddress(const char *host, const char *port,
  * \return '0' if everything is fine, '-1' if some errors occurred. The error message is returned
  * in the 'errbuf' variable.
  */
-int sock_send(SOCKET socket, const char *buffer, int size, char *errbuf, int errbuflen)
+int sock_send(SOCKET sock, const char *buffer, int size, char *errbuf, int errbuflen)
 {
        int nsent;
 
@@ -567,9 +567,9 @@ send:
         * sockets when the other end breaks the connection.
         * The EPIPE error is still returned.
         */
-       nsent = send(socket, buffer, size, MSG_NOSIGNAL);
+       nsent = send(sock, buffer, size, MSG_NOSIGNAL);
 #else
-       nsent = send(socket, buffer, size, 0);
+       nsent = send(sock, buffer, size, 0);
 #endif
 
        if (nsent == -1)
index f50bbce881f6da3e172be41ededcb4dcb5c6a082..6ffadf6cc7fb4b61f755ebf767d58df6959f54c3 100644 (file)
@@ -210,14 +210,14 @@ void sock_geterror(const char *caller, char *errbuf, int errbufsize);
 int sock_initaddress(const char *address, const char *port,
     struct addrinfo *hints, struct addrinfo **addrinfo,
     char *errbuf, int errbuflen);
-int sock_recv(SOCKET socket, void *buffer, size_t size, int receiveall,
+int sock_recv(SOCKET sock, void *buffer, size_t size, int receiveall,
     char *errbuf, int errbuflen);
 SOCKET sock_open(struct addrinfo *addrinfo, int server, int nconn, char *errbuf, int errbuflen);
 int sock_close(SOCKET sock, char *errbuf, int errbuflen);
 
-int sock_send(SOCKET socket, const char *buffer, int size, char *errbuf, int errbuflen);
+int sock_send(SOCKET sock, const char *buffer, int size, char *errbuf, int errbuflen);
 int sock_bufferize(const char *buffer, int size, char *tempbuf, int *offset, int totsize, int checkonly, char *errbuf, int errbuflen);
-int sock_discard(SOCKET socket, int size, char *errbuf, int errbuflen);
+int sock_discard(SOCKET sock, int size, char *errbuf, int errbuflen);
 int    sock_check_hostlist(char *hostlist, const char *sep, struct sockaddr_storage *from, char *errbuf, int errbuflen);
 int sock_cmpaddr(struct sockaddr_storage *first, struct sockaddr_storage *second);