]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Cleanup: use C++ cerrno instead of C errno.h
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 2 Jun 2014 07:19:35 +0000 (00:19 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 2 Jun 2014 07:19:35 +0000 (00:19 -0700)
46 files changed:
compat/xstring.cc
compat/xstrto.cc
helpers/external_acl/kerberos_ldap_group/support_ldap.cc
helpers/external_acl/kerberos_ldap_group/support_resolv.cc
src/DiskIO/AIO/AIODiskFile.cc
src/DiskIO/AIO/aio_win32.cc
src/DiskIO/Blocking/BlockingFile.cc
src/DiskIO/DiskDaemon/DiskdIOStrategy.cc
src/DiskIO/DiskThreads/DiskThreadsDiskFile.cc
src/DiskIO/DiskThreads/aiops.cc
src/DiskIO/DiskThreads/aiops_win32.cc
src/DiskIO/IpcIo/IpcIoFile.cc
src/DiskIO/Mmapped/MmappedFile.cc
src/FwdState.cc
src/HttpHeaderTools.cc
src/cache_diff.cc
src/comm/ConnOpener.cc
src/comm/ModEpoll.cc
src/comm/ModKqueue.cc
src/comm/ModPoll.cc
src/comm/ModSelect.cc
src/comm/ModSelectWin32.cc
src/comm/TcpAcceptor.cc
src/disk.cc
src/dns_internal.cc
src/eui/Eui48.cc
src/fs/rock/RockRebuild.cc
src/ftp.cc
src/icmp/IcmpPinger.cc
src/icmp/IcmpSquid.cc
src/icp_v2.cc
src/ip/Intercept.cc
src/ip/QosConfig.cc
src/ipc/Coordinator.cc
src/ipc/StartListening.cc
src/ipc_win32.cc
src/log/ModDaemon.cc
src/log/ModStdio.cc
src/log/ModUdp.cc
src/main.cc
src/parser/Tokenizer.cc
src/ssl/support.cc
src/store_rebuild.cc
src/test_cache_digest.cc
src/tools.cc
src/whois.cc

index 3a288780c79d2e99ad5af118df1d05509ee7a543..622695802114e373727cab48ea31a28467e47848 100644 (file)
@@ -2,9 +2,7 @@
 #include "compat/xalloc.h"
 #include "compat/xstring.h"
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
 
 char *
 xstrdup(const char *s)
index e6482ece4a500a6d1e11150d3de6b231a828efe7..d6d9c07d41df210b4735701f1e97edbdca5b6a26 100644 (file)
@@ -47,9 +47,7 @@
  *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
 
 bool
 xstrtoul(const char *s, char **end, unsigned long *value,
index 73e7ec582e9d0edb4d8f82e813c17a689b94e4b9..553770b57b3f8a6b29729c3918bae32230768a29 100644 (file)
@@ -28,9 +28,7 @@
 #ifdef HAVE_LDAP
 
 #include "support.h"
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
 
 char *convert_domain_to_bind_path(char *domain);
 char *escape_filter(char *filter);
index aa11112dd030916f652f84956507fb05da7bab58..93e1d499813cc664d9192ba2207abda25b1104b4 100644 (file)
@@ -28,9 +28,7 @@
 #ifdef HAVE_LDAP
 
 #include "support.h"
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
 #ifdef HAVE_NETDB_H
 #include <netdb.h>
 #endif
index b16e4dc0103c5c6d78c6b2b12c405b8f20dc0a8a..b22c4c763251020acef398c54cfd68b2c30e07fe 100644 (file)
@@ -53,9 +53,7 @@
 #include "DiskIO/WriteRequest.h"
 #include "globals.h"
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
 
 CBDATA_CLASS_INIT(AIODiskFile);
 
index 606d2473da3fe8a27b9dc1c32ee12df2fa122eaf..0097664d84411b005d0234724eb3dad194ebcc23 100644 (file)
@@ -38,9 +38,7 @@
 #include "StatCounters.h"
 #include "win32.h"
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
 
 #if _SQUID_WINDOWS_
 VOID CALLBACK IoCompletionRoutine(DWORD dwErrorCode,
index c8c2c99724d3a62cc731c2693f680becd5d93fa7..0ea40d1e970568a5f90d73c7d8e46232624e1c26 100644 (file)
@@ -40,9 +40,7 @@
 #include "DiskIO/WriteRequest.h"
 #include "globals.h"
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
 
 CBDATA_CLASS_INIT(BlockingFile);
 
index cb1a482a25a45e0fa8e974af522c8819b2d34bd4..1892e433b3a9d77f417b6e07ba7cdbb9e8ca0011 100644 (file)
@@ -46,6 +46,7 @@
 #include "Store.h"
 #include "unlinkd.h"
 
+#include <cerrno>
 #if HAVE_SYS_IPC_H
 #include <sys/ipc.h>
 #endif
@@ -55,9 +56,6 @@
 #if HAVE_SYS_SHM_H
 #include <sys/shm.h>
 #endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
 
 diskd_stats_t diskd_stats;
 
index 3ee452e34ece6c4c425f5967bc4c9eebefe8d5cb..31b6377b3d356ce58862794365f6c45d85f70913 100644 (file)
@@ -43,9 +43,7 @@
 #include "StatCounters.h"
 #include "Store.h"
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
 
 /* === PUBLIC =========================================================== */
 
index b18220837c29896d23d66a19661a2a3b952cafcd..a56598ba4b5205267d8e29837f71d39baa14a4db 100644 (file)
 #include "SquidTime.h"
 #include "Store.h"
 
+#include <cerrno>
 #include <csignal>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <pthread.h>
-#include <errno.h>
 #include <dirent.h>
 #if HAVE_SCHED_H
 #include <sched.h>
index 4967789fe3dc3795b3315c2b6566307dd8857045..bf95ffd3368512c0aa8d4ea112dbb8056bd7da67 100644 (file)
 #include "SquidTime.h"
 #include "Store.h"
 
+#include <cerrno>
 #include <csignal>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <errno.h>
 #include <dirent.h>
 
 #define RIDICULOUS_LENGTH      4096
index 6b7a67500a78b24cc51183c481a7c5b7c4fb6616..e522001f21a24758b7c1718dcbced3d12dd76f1b 100644 (file)
@@ -23,9 +23,8 @@
 #include "StatCounters.h"
 #include "tools.h"
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
+
 CBDATA_CLASS_INIT(IpcIoFile);
 
 /// shared memory segment path to use for IpcIoFile maps
index 2c067463707b19ecf13b6b049d8728bdf991beeb..da6b81795f27acb904ab7ce40fa677fbbd525c21 100644 (file)
 #include "DiskIO/WriteRequest.h"
 #include "globals.h"
 
+#include <cerrno>
 #if HAVE_SYS_MMAN_H
 #include <sys/mman.h>
 #endif
 #if HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
 
 // Some systems such as Hurd provide mmap() API but do not support MAP_NORESERVE
 #ifndef MAP_NORESERVE
index 8dc659584980c5f2944d0a464ea0a99b03579c69..ccdd03c9e4d18cbb1b840030b57177e887e89173 100644 (file)
@@ -81,9 +81,8 @@
 #include "ssl/ServerBump.h"
 #include "ssl/support.h"
 #endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+
+#include <cerrno>
 
 static PSC fwdPeerSelectionCompleteWrapper;
 static CLCB fwdServerClosedWrapper;
index 16fe5e34e9907427caff7f8302b3aa3341e913a2..a4bce3313b67b9c6397251df309e2e9d9aa0fc9c 100644 (file)
 #endif
 
 #include <algorithm>
+#include <cerrno>
 #include <string>
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
 
 static void httpHeaderPutStrvf(HttpHeader * hdr, http_hdr_type id, const char *fmt, va_list vargs);
 
index 99fdb9a53f2d719bbaa05c945b97f2333c9e1ca8..8e9f1c8dfc477e32c7d4a3c1ed738f176595a699 100644 (file)
  */
 
 #include "squid.h"
-
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
 
 typedef struct {
     const char *name;
index c2913dbc55496aa456ffb59b16028f157f00921c..fd26497ff4581dbbf08166f10af726d5e0ddbd7d 100644 (file)
@@ -17,9 +17,7 @@
 #include "SquidConfig.h"
 #include "SquidTime.h"
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
 
 class CachePeer;
 
index 5072d7b9a90bfc0783e9732b8dba13202ade4d0d..d7cb229a646b2fd4a394e2fa5415add02b54d83c 100644 (file)
 
 #define DEBUG_EPOLL 0
 
+#include <cerrno>
 #if HAVE_SYS_EPOLL_H
 #include <sys/epoll.h>
 #endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
 
 static int kdpfd;
 static int max_poll_time = 1000;
index 1a4d4248f959ea3285b19e813590b963309c8aba..b87f5d60ad819e45c5e26f70c6b560af4c0bd32b 100644 (file)
 #include "StatCounters.h"
 #include "Store.h"
 
+#include <cerrno>
 #if HAVE_SYS_EVENT_H
 #include <sys/event.h>
 #endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
 
 #define KE_LENGTH        128
 
index e7bbe182b80df8b56594a670284b8298a4251ae3..dd3bd3349fee5ba6adb05baf97bb718d36915105 100644 (file)
 #include "StatCounters.h"
 #include "Store.h"
 
+#include <cerrno>
 #if HAVE_POLL_H
 #include <poll.h>
 #endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
 
 /* Needed for poll() on Linux at least */
 #if USE_POLL
index 47c822566983a114fea20d8931aa61c7dc9f6f17..03e04884b04b46fc489196bcc27736661c087254 100644 (file)
 #include "StatHist.h"
 #include "Store.h"
 
+#include <cerrno>
 #if HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
 
 static int MAX_POLL_TIME = 1000;       /* see also Comm::QuickPollRequired() */
 
index b3292c65a43bd2e31827059256444372bc17841f..1b52dcd39e671f8ba6ca50676cb1fb247173e23a 100644 (file)
@@ -42,9 +42,7 @@
 #include "StatHist.h"
 #include "Store.h"
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
 
 static int MAX_POLL_TIME = 1000;       /* see also Comm::QuickPollRequired() */
 
index 44a6c8263a4623be7ed23b5e0e98e29d187be764..85e3d0ec8bf69544d2336585e67dd54eb02f9a00 100644 (file)
@@ -53,9 +53,7 @@
 #include "SquidTime.h"
 #include "StatCounters.h"
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
 #ifdef HAVE_NETINET_TCP_H
 // required for accept_filter to build.
 #include <netinet/tcp.h>
index fc9567e26f8d14923213142cae2d178ab5dc2332..d1dc04c90e7520e02bdcec75b71fe2e5edd9c03c 100644 (file)
@@ -41,9 +41,7 @@
 #include "profiler/Profiler.h"
 #include "StatCounters.h"
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
 
 static PF diskHandleRead;
 static PF diskHandleWrite;
index a8f6837e07df3a0c62f412e5d39312753a175f3e..120e9dd03f2fbea0cae15b83cfc93901b7d9c896 100644 (file)
 #if HAVE_ARPA_NAMESER_H
 #include <arpa/nameser.h>
 #endif
+#include <cerrno>
 #if HAVE_RESOLV_H
 #include <resolv.h>
 #endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
 
 #if _SQUID_WINDOWS_
 #define REG_TCPIP_PARA_INTERFACES "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces"
index f97fe2b6b497ad536364fab23bf581f677cf3c0f..45a61ce46e10fa20ece052e6abf9c0e1ddbdf4a6 100644 (file)
@@ -41,9 +41,7 @@
 #include "globals.h"
 #include "ip/Address.h"
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
 
 /* START Legacy includes pattern */
 /* TODO: clean this up so we dont have per-OS requirements.
index e230bdf6875b720d5b0f2746067f9aa1d4acb5d3..45f54279258b9c6709576173180dd4c5c501b920 100644 (file)
@@ -15,9 +15,7 @@
 #include "tools.h"
 #include "typedefs.h"
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
 
 CBDATA_NAMESPACED_CLASS_INIT(Rock, Rebuild);
 
index 214106437dd23efd4d8054174a6346ad557fd982..2acaafee9ea807d541f14cebfba5538e697b50da 100644 (file)
@@ -68,9 +68,7 @@
 #include "MemObject.h"
 #endif
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
 
 /**
  \defgroup ServerProtocolFTPInternal Server-Side FTP Internals
index e49c69b8cdc62772566b815fd47662ef1d965a18..bc8e5e0fb413aa7eccb378a261d2dd882e6e3661 100644 (file)
@@ -42,9 +42,7 @@
 #include "IcmpPinger.h"
 #include "SquidTime.h"
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
 
 IcmpPinger::IcmpPinger() : Icmp()
 {
index e2c0493a44a8a7069b497e05989d202ac992f7c5..f6483a4fc64c6dc717d3aa98db495481af2698c2 100644 (file)
@@ -42,9 +42,7 @@
 #include "SquidIpc.h"
 #include "SquidTime.h"
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
 
 // Instance global to be available in main() and elsewhere.
 IcmpSquid icmpEngine;
index a51090f63e1ff28d7f360a8e5f9c6cd860cb6299..adcafa308d7491012b787f1a2b247bc0bfcfc229 100644 (file)
@@ -65,9 +65,7 @@
 #include "tools.h"
 #include "wordlist.h"
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
 
 static void icpIncomingConnectionOpened(const Comm::ConnectionPointer &conn, int errNo);
 
index 343916207b3eea5c975a9da5def7b2163d40e75b..feaa5c61cebc1269134b00af34466383d6a606fe 100644 (file)
@@ -36,6 +36,8 @@
 #include "ip/Intercept.h"
 #include "src/tools.h"
 
+#include <cerrno>
+
 #if IPF_TRANSPARENT
 
 #if HAVE_SYS_IOCTL_H
@@ -71,9 +73,6 @@
 #elif HAVE_NETINET_IP_NAT_H
 #include <netinet/ip_nat.h>
 #endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
 
 #endif /* IPF_TRANSPARENT required headers */
 
index c1a52675f30a21e0c9c43e0d5541bc8b331978b9..871b9d364e8356a94c06bdc145f31e5e6f594a46 100644 (file)
 #include "ip/tools.h"
 #include "Parsing.h"
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
-
-/* Qos namespace */
+#include <cerrno>
 
 void
 Ip::Qos::getTosFromServer(const Comm::ConnectionPointer &server, fde *clientFde)
index bb7318fcba712ab81be14d124d5acca51f6c6dfe..26457d05e8b6f7dafe08886a4428f13cee4afc15 100644 (file)
@@ -20,9 +20,8 @@
 #include "snmp/Request.h"
 #include "snmp/Response.h"
 #endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+
+#include <cerrno>
 
 CBDATA_NAMESPACED_CLASS_INIT(Ipc, Coordinator);
 Ipc::Coordinator* Ipc::Coordinator::TheInstance = NULL;
index cd31ba54950c5bc8f5d64e4d822823e5870866e0..9bfe92118ee376691c5bd2cefbb27bd30120cb9f 100644 (file)
@@ -11,9 +11,7 @@
 #include "ipc/StartListening.h"
 #include "tools.h"
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
 
 Ipc::StartListeningCb::StartListeningCb(): conn(NULL), errNo(0)
 {
index 01513139b2e8c84536a855ac82be17df568bcf90..c84e51724deed22ee8862e8d10fb34237cb8ad16 100644 (file)
 #include "SquidTime.h"
 #include "tools.h"
 
+#include <cerrno>
 #ifndef _MSWSOCK_
 #include <mswsock.h>
 #endif
 #include <process.h>
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
 
 struct ipc_params {
     int type;
index e03b677333cedbed3307a1d0badc82d036041ec5..88a49f9283d5396b57ca95307e2dcd5c38a0aa03 100644 (file)
@@ -42,9 +42,7 @@
 #include "SquidIpc.h"
 #include "SquidTime.h"
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
 
 /* How many buffers to keep before we say we've buffered too much */
 #define        LOGFILE_MAXBUFS         128
index 32b4832f7fedee0244d06f25586fa49251e77a3a..1425fd08d5f0fb97a8682a792c5d63e5f1d6b611 100644 (file)
@@ -39,9 +39,7 @@
 #include "log/ModStdio.h"
 #include "SquidConfig.h"
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
 
 typedef struct {
     int fd;
index 9191ad93d0432cab4701c9f4056b3bc383f40351..cd657dce9bc54ed309684acfa21446527ffe4d92 100644 (file)
@@ -40,9 +40,7 @@
 #include "Parsing.h"
 #include "SquidConfig.h"
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
 
 /*
  * This logfile UDP module is mostly inspired by a patch by Tim Starling
index ba13a2eec38de70f0d0ff676b4b7d76d18a6a97a..f388a8fa51f0760c583ac466ec41a3899dbd834d 100644 (file)
 #include "snmp_core.h"
 #endif
 
+#include <cerrno>
 #if HAVE_PATHS_H
 #include <paths.h>
 #endif
 #if HAVE_SYS_WAIT_H
 #include <sys/wait.h>
 #endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
 
 #if USE_WIN32_SERVICE
 #include <process.h>
index a13e218ebe88a2e81280560a5076a5087db4ed0a..4b0ec9510995be401449f7df2ff30d9ac72eca12 100644 (file)
@@ -1,12 +1,10 @@
 #include "squid.h"
 #include "parser/Tokenizer.h"
 
+#include <cerrno>
 #if HAVE_CTYPE_H
 #include <ctype.h>
 #endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
 #if HAVE_STDINT_H
 #include <stdint.h>
 #endif
index 7e83ac85727b53fe25cd7180ded9b372ffdb14de..fad05b9b0c11ea92d2f904650d27681bffdae5df 100644 (file)
@@ -51,9 +51,7 @@
 #include "ssl/support.h"
 #include "URL.h"
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
 
 static void setSessionCallbacks(SSL_CTX *ctx);
 Ipc::MemMap *SslSessionCache = NULL;
index a80bc9d57810a447f4d63d60234996410a2a9a21..5a21a0b3e8ee54e6edad7985b236c8f6c87c8c42 100644 (file)
@@ -44,9 +44,8 @@
 #include "StoreSearch.h"
 #include "SwapDir.h"
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
+
 static StoreRebuildData counts;
 
 static struct timeval rebuild_start;
index 8613f8b1728d7e8c9f27b8dea1ed66603d8fa8c7..5af008f8ba6a47c1d476c9f259d8bf6fa5e9d91d 100644 (file)
@@ -38,9 +38,7 @@
 #include "CacheDigest.h"
 #include "store_key_md5.h"
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
 
 typedef struct {
     int query_count;
index 19a61365cda368453eaaa86c5a4d4444f43fd041..4d275a6b293d7f42d6ef1217d0d77cf48d3d00a7 100644 (file)
@@ -52,6 +52,7 @@
 #include "tools.h"
 #include "wordlist.h"
 
+#include <cerrno>
 #if HAVE_SYS_PRCTL_H
 #include <sys/prctl.h>
 #endif
@@ -67,9 +68,6 @@
 #if HAVE_GRP_H
 #include <grp.h>
 #endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
 
 #define DEAD_MSG "\
 The Squid Cache (version %s) died.\n\
index 4f5201611b3079f09b2b57810fa7ca0b708a8d0e..7cfb39e016cd51f85982d9d7c9baea0e5a6a8bd5 100644 (file)
@@ -43,9 +43,7 @@
 #include "Store.h"
 #include "tools.h"
 
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
 
 #define WHOIS_PORT 43