]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - tools/purge/socket.cc
SourceFormat Enforcement
[thirdparty/squid.git] / tools / purge / socket.cc
index d8884f10b8b704211632bb494f6ed10f1fbb90f0..a2fc2d93e19df6ca937520e74ca3d5e99cbbdd9c 100644 (file)
@@ -1,4 +1,11 @@
-#include "squid.h"
+/*
+ * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
 // Author:  Jens-S. V?ckler <voeckler@rvs.uni-hannover.de>
 //
 // File:    socket.hh
 // Revision 1.1  1998/08/13 21:52:55  voeckler
 // Initial revision
 //
-//
-#if (defined(__GNUC__) || defined(__GNUG__)) && !defined(__clang__)
-#pragma implementation
-#endif
 
+#include "squid.h"
 #include "socket.hh"
+
+#include <cerrno>
+#include <cstring>
 #include <netinet/tcp.h>
 #include <arpa/inet.h>
 #include <netdb.h>
 
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
 #include <unistd.h>
 
 #include "convert.hh"
@@ -100,7 +104,7 @@ getSocketNoDelay( int sockfd )
 }
 
 int
-setSocketNoDelay( int sockfd, bool nodelay )
+setSocketNoDelay( int sockfd, bool)
 // purpose: get state of the TCP_NODELAY of the socket
 // paramtr: sockfd (IN): socket descriptor
 //          nodelay (IN): true, if TCP_NODELAY is to be set, false otherwise.
@@ -218,9 +222,9 @@ serverSocket( struct in_addr host, unsigned short port,
     }
 
     if ( reuse ) {
-        int reuse = 1;
+        int opt = 1;
         if ( setsockopt( sockfd, SOL_SOCKET, SO_REUSEADDR,
-                         (char*) &reuse, sizeof(int) ) == -1) {
+                         (char*) &opt, sizeof(int) ) == -1) {
             perror( "setsockopt( SO_REUSEADDR )" );
             close( sockfd );
             return -1;
@@ -251,3 +255,4 @@ serverSocket( struct in_addr host, unsigned short port,
 
     return sockfd;
 }
+