------------------------------------------------------------ revno: 13436 revision-id: squid3@treenet.co.nz-20140602071935-ssq6hj5ko9p0s21o parent: squid3@treenet.co.nz-20140602062312-12svjpsl7oiq8xjn committer: Amos Jeffries branch nick: trunk timestamp: Mon 2014-06-02 00:19:35 -0700 message: Cleanup: use C++ cerrno instead of C errno.h ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20140602071935-ssq6hj5ko9p0s21o # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: cfc33de90d4a64287cbc351a610f9a89e9fbe57c # timestamp: 2014-06-02 07:53:58 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: squid3@treenet.co.nz-20140602062312-\ # 12svjpsl7oiq8xjn # # Begin patch === modified file 'compat/xstring.cc' --- compat/xstring.cc 2012-07-23 15:15:27 +0000 +++ compat/xstring.cc 2014-06-02 07:19:35 +0000 @@ -2,9 +2,7 @@ #include "compat/xalloc.h" #include "compat/xstring.h" -#if HAVE_ERRNO_H -#include -#endif +#include char * xstrdup(const char *s) === modified file 'compat/xstrto.cc' --- compat/xstrto.cc 2014-01-06 01:10:00 +0000 +++ compat/xstrto.cc 2014-06-02 07:19:35 +0000 @@ -47,9 +47,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#if HAVE_ERRNO_H -#include -#endif +#include bool xstrtoul(const char *s, char **end, unsigned long *value, === modified file 'helpers/external_acl/kerberos_ldap_group/support_ldap.cc' --- helpers/external_acl/kerberos_ldap_group/support_ldap.cc 2013-10-31 19:25:50 +0000 +++ helpers/external_acl/kerberos_ldap_group/support_ldap.cc 2014-06-02 07:19:35 +0000 @@ -28,9 +28,7 @@ #ifdef HAVE_LDAP #include "support.h" -#ifdef HAVE_ERRNO_H -#include -#endif +#include char *convert_domain_to_bind_path(char *domain); char *escape_filter(char *filter); === modified file 'helpers/external_acl/kerberos_ldap_group/support_resolv.cc' --- helpers/external_acl/kerberos_ldap_group/support_resolv.cc 2014-02-08 13:36:42 +0000 +++ helpers/external_acl/kerberos_ldap_group/support_resolv.cc 2014-06-02 07:19:35 +0000 @@ -28,9 +28,7 @@ #ifdef HAVE_LDAP #include "support.h" -#ifdef HAVE_ERRNO_H -#include -#endif +#include #ifdef HAVE_NETDB_H #include #endif === modified file 'src/DiskIO/AIO/AIODiskFile.cc' --- src/DiskIO/AIO/AIODiskFile.cc 2013-10-25 00:13:46 +0000 +++ src/DiskIO/AIO/AIODiskFile.cc 2014-06-02 07:19:35 +0000 @@ -53,9 +53,7 @@ #include "DiskIO/WriteRequest.h" #include "globals.h" -#if HAVE_ERRNO_H -#include -#endif +#include CBDATA_CLASS_INIT(AIODiskFile); === modified file 'src/DiskIO/AIO/aio_win32.cc' --- src/DiskIO/AIO/aio_win32.cc 2013-10-25 00:13:46 +0000 +++ src/DiskIO/AIO/aio_win32.cc 2014-06-02 07:19:35 +0000 @@ -38,9 +38,7 @@ #include "StatCounters.h" #include "win32.h" -#if HAVE_ERRNO_H -#include -#endif +#include #if _SQUID_WINDOWS_ VOID CALLBACK IoCompletionRoutine(DWORD dwErrorCode, === modified file 'src/DiskIO/Blocking/BlockingFile.cc' --- src/DiskIO/Blocking/BlockingFile.cc 2014-02-08 13:36:42 +0000 +++ src/DiskIO/Blocking/BlockingFile.cc 2014-06-02 07:19:35 +0000 @@ -40,9 +40,7 @@ #include "DiskIO/WriteRequest.h" #include "globals.h" -#if HAVE_ERRNO_H -#include -#endif +#include CBDATA_CLASS_INIT(BlockingFile); === modified file 'src/DiskIO/DiskDaemon/DiskdIOStrategy.cc' --- src/DiskIO/DiskDaemon/DiskdIOStrategy.cc 2013-10-25 00:13:46 +0000 +++ src/DiskIO/DiskDaemon/DiskdIOStrategy.cc 2014-06-02 07:19:35 +0000 @@ -46,6 +46,7 @@ #include "Store.h" #include "unlinkd.h" +#include #if HAVE_SYS_IPC_H #include #endif @@ -55,9 +56,6 @@ #if HAVE_SYS_SHM_H #include #endif -#if HAVE_ERRNO_H -#include -#endif diskd_stats_t diskd_stats; === modified file 'src/DiskIO/DiskThreads/DiskThreadsDiskFile.cc' --- src/DiskIO/DiskThreads/DiskThreadsDiskFile.cc 2014-02-08 13:36:42 +0000 +++ src/DiskIO/DiskThreads/DiskThreadsDiskFile.cc 2014-06-02 07:19:35 +0000 @@ -43,9 +43,7 @@ #include "StatCounters.h" #include "Store.h" -#if HAVE_ERRNO_H -#include -#endif +#include /* === PUBLIC =========================================================== */ === modified file 'src/DiskIO/DiskThreads/aiops.cc' --- src/DiskIO/DiskThreads/aiops.cc 2014-02-21 10:46:19 +0000 +++ src/DiskIO/DiskThreads/aiops.cc 2014-06-02 07:19:35 +0000 @@ -41,11 +41,11 @@ #include "SquidTime.h" #include "Store.h" +#include #include #include #include #include -#include #include #if HAVE_SCHED_H #include === modified file 'src/DiskIO/DiskThreads/aiops_win32.cc' --- src/DiskIO/DiskThreads/aiops_win32.cc 2014-02-21 10:46:19 +0000 +++ src/DiskIO/DiskThreads/aiops_win32.cc 2014-06-02 07:19:35 +0000 @@ -40,10 +40,10 @@ #include "SquidTime.h" #include "Store.h" +#include #include #include #include -#include #include #define RIDICULOUS_LENGTH 4096 === modified file 'src/DiskIO/IpcIo/IpcIoFile.cc' --- src/DiskIO/IpcIo/IpcIoFile.cc 2014-02-21 16:14:05 +0000 +++ src/DiskIO/IpcIo/IpcIoFile.cc 2014-06-02 07:19:35 +0000 @@ -23,9 +23,8 @@ #include "StatCounters.h" #include "tools.h" -#if HAVE_ERRNO_H -#include -#endif +#include + CBDATA_CLASS_INIT(IpcIoFile); /// shared memory segment path to use for IpcIoFile maps === modified file 'src/DiskIO/Mmapped/MmappedFile.cc' --- src/DiskIO/Mmapped/MmappedFile.cc 2013-10-25 00:13:46 +0000 +++ src/DiskIO/Mmapped/MmappedFile.cc 2014-06-02 07:19:35 +0000 @@ -11,15 +11,13 @@ #include "DiskIO/WriteRequest.h" #include "globals.h" +#include #if HAVE_SYS_MMAN_H #include #endif #if HAVE_SYS_STAT_H #include #endif -#if HAVE_ERRNO_H -#include -#endif // Some systems such as Hurd provide mmap() API but do not support MAP_NORESERVE #ifndef MAP_NORESERVE === modified file 'src/FwdState.cc' --- src/FwdState.cc 2014-05-09 04:45:54 +0000 +++ src/FwdState.cc 2014-06-02 07:19:35 +0000 @@ -81,9 +81,8 @@ #include "ssl/ServerBump.h" #include "ssl/support.h" #endif -#if HAVE_ERRNO_H -#include -#endif + +#include static PSC fwdPeerSelectionCompleteWrapper; static CLCB fwdServerClosedWrapper; === modified file 'src/HttpHeaderTools.cc' --- src/HttpHeaderTools.cc 2014-03-30 12:00:34 +0000 +++ src/HttpHeaderTools.cc 2014-06-02 07:19:35 +0000 @@ -55,10 +55,8 @@ #endif #include +#include #include -#if HAVE_ERRNO_H -#include -#endif static void httpHeaderPutStrvf(HttpHeader * hdr, http_hdr_type id, const char *fmt, va_list vargs); === modified file 'src/cache_diff.cc' --- src/cache_diff.cc 2014-04-22 02:47:09 +0000 +++ src/cache_diff.cc 2014-06-02 07:19:35 +0000 @@ -37,10 +37,7 @@ */ #include "squid.h" - -#if HAVE_ERRNO_H -#include -#endif +#include typedef struct { const char *name; === modified file 'src/comm/ConnOpener.cc' --- src/comm/ConnOpener.cc 2014-01-19 05:39:55 +0000 +++ src/comm/ConnOpener.cc 2014-06-02 07:19:35 +0000 @@ -17,9 +17,7 @@ #include "SquidConfig.h" #include "SquidTime.h" -#if HAVE_ERRNO_H -#include -#endif +#include class CachePeer; === modified file 'src/comm/ModEpoll.cc' --- src/comm/ModEpoll.cc 2012-09-01 14:38:36 +0000 +++ src/comm/ModEpoll.cc 2014-06-02 07:19:35 +0000 @@ -65,12 +65,10 @@ #define DEBUG_EPOLL 0 +#include #if HAVE_SYS_EPOLL_H #include #endif -#if HAVE_ERRNO_H -#include -#endif static int kdpfd; static int max_poll_time = 1000; === modified file 'src/comm/ModKqueue.cc' --- src/comm/ModKqueue.cc 2013-05-22 00:13:36 +0000 +++ src/comm/ModKqueue.cc 2014-06-02 07:19:35 +0000 @@ -60,12 +60,10 @@ #include "StatCounters.h" #include "Store.h" +#include #if HAVE_SYS_EVENT_H #include #endif -#if HAVE_ERRNO_H -#include -#endif #define KE_LENGTH 128 === modified file 'src/comm/ModPoll.cc' --- src/comm/ModPoll.cc 2013-01-30 15:39:37 +0000 +++ src/comm/ModPoll.cc 2014-06-02 07:19:35 +0000 @@ -45,12 +45,10 @@ #include "StatCounters.h" #include "Store.h" +#include #if HAVE_POLL_H #include #endif -#if HAVE_ERRNO_H -#include -#endif /* Needed for poll() on Linux at least */ #if USE_POLL === modified file 'src/comm/ModSelect.cc' --- src/comm/ModSelect.cc 2013-10-25 00:13:46 +0000 +++ src/comm/ModSelect.cc 2014-06-02 07:19:35 +0000 @@ -45,12 +45,10 @@ #include "StatHist.h" #include "Store.h" +#include #if HAVE_SYS_STAT_H #include #endif -#if HAVE_ERRNO_H -#include -#endif static int MAX_POLL_TIME = 1000; /* see also Comm::QuickPollRequired() */ === modified file 'src/comm/ModSelectWin32.cc' --- src/comm/ModSelectWin32.cc 2012-09-01 14:38:36 +0000 +++ src/comm/ModSelectWin32.cc 2014-06-02 07:19:35 +0000 @@ -42,9 +42,7 @@ #include "StatHist.h" #include "Store.h" -#if HAVE_ERRNO_H -#include -#endif +#include static int MAX_POLL_TIME = 1000; /* see also Comm::QuickPollRequired() */ === modified file 'src/comm/TcpAcceptor.cc' --- src/comm/TcpAcceptor.cc 2014-06-02 05:09:38 +0000 +++ src/comm/TcpAcceptor.cc 2014-06-02 07:19:35 +0000 @@ -53,9 +53,7 @@ #include "SquidTime.h" #include "StatCounters.h" -#if HAVE_ERRNO_H -#include -#endif +#include #ifdef HAVE_NETINET_TCP_H // required for accept_filter to build. #include === modified file 'src/disk.cc' --- src/disk.cc 2013-01-30 15:39:37 +0000 +++ src/disk.cc 2014-06-02 07:19:35 +0000 @@ -41,9 +41,7 @@ #include "profiler/Profiler.h" #include "StatCounters.h" -#if HAVE_ERRNO_H -#include -#endif +#include static PF diskHandleRead; static PF diskHandleWrite; === modified file 'src/dns_internal.cc' --- src/dns_internal.cc 2014-01-09 20:27:49 +0000 +++ src/dns_internal.cc 2014-06-02 07:19:35 +0000 @@ -60,12 +60,10 @@ #if HAVE_ARPA_NAMESER_H #include #endif +#include #if HAVE_RESOLV_H #include #endif -#if HAVE_ERRNO_H -#include -#endif #if _SQUID_WINDOWS_ #define REG_TCPIP_PARA_INTERFACES "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces" === modified file 'src/eui/Eui48.cc' --- src/eui/Eui48.cc 2014-04-14 06:57:22 +0000 +++ src/eui/Eui48.cc 2014-06-02 07:19:35 +0000 @@ -41,9 +41,7 @@ #include "globals.h" #include "ip/Address.h" -#if HAVE_ERRNO_H -#include -#endif +#include /* START Legacy includes pattern */ /* TODO: clean this up so we dont have per-OS requirements. === modified file 'src/fs/rock/RockRebuild.cc' --- src/fs/rock/RockRebuild.cc 2013-12-31 18:49:41 +0000 +++ src/fs/rock/RockRebuild.cc 2014-06-02 07:19:35 +0000 @@ -15,9 +15,7 @@ #include "tools.h" #include "typedefs.h" -#if HAVE_ERRNO_H -#include -#endif +#include CBDATA_NAMESPACED_CLASS_INIT(Rock, Rebuild); === modified file 'src/ftp.cc' --- src/ftp.cc 2014-05-07 14:40:05 +0000 +++ src/ftp.cc 2014-06-02 07:19:35 +0000 @@ -68,9 +68,7 @@ #include "MemObject.h" #endif -#if HAVE_ERRNO_H -#include -#endif +#include /** \defgroup ServerProtocolFTPInternal Server-Side FTP Internals === modified file 'src/icmp/IcmpPinger.cc' --- src/icmp/IcmpPinger.cc 2013-10-25 00:13:46 +0000 +++ src/icmp/IcmpPinger.cc 2014-06-02 07:19:35 +0000 @@ -42,9 +42,7 @@ #include "IcmpPinger.h" #include "SquidTime.h" -#if HAVE_ERRNO_H -#include -#endif +#include IcmpPinger::IcmpPinger() : Icmp() { === modified file 'src/icmp/IcmpSquid.cc' --- src/icmp/IcmpSquid.cc 2013-06-03 14:05:16 +0000 +++ src/icmp/IcmpSquid.cc 2014-06-02 07:19:35 +0000 @@ -42,9 +42,7 @@ #include "SquidIpc.h" #include "SquidTime.h" -#if HAVE_ERRNO_H -#include -#endif +#include // Instance global to be available in main() and elsewhere. IcmpSquid icmpEngine; === modified file 'src/icp_v2.cc' --- src/icp_v2.cc 2014-02-08 13:36:42 +0000 +++ src/icp_v2.cc 2014-06-02 07:19:35 +0000 @@ -65,9 +65,7 @@ #include "tools.h" #include "wordlist.h" -#if HAVE_ERRNO_H -#include -#endif +#include static void icpIncomingConnectionOpened(const Comm::ConnectionPointer &conn, int errNo); === modified file 'src/ip/Intercept.cc' --- src/ip/Intercept.cc 2014-02-21 10:46:19 +0000 +++ src/ip/Intercept.cc 2014-06-02 07:19:35 +0000 @@ -36,6 +36,8 @@ #include "ip/Intercept.h" #include "src/tools.h" +#include + #if IPF_TRANSPARENT #if HAVE_SYS_IOCTL_H @@ -71,9 +73,6 @@ #elif HAVE_NETINET_IP_NAT_H #include #endif -#if HAVE_ERRNO_H -#include -#endif #endif /* IPF_TRANSPARENT required headers */ === modified file 'src/ip/QosConfig.cc' --- src/ip/QosConfig.cc 2013-10-25 00:13:46 +0000 +++ src/ip/QosConfig.cc 2014-06-02 07:19:35 +0000 @@ -11,11 +11,7 @@ #include "ip/tools.h" #include "Parsing.h" -#if HAVE_ERRNO_H -#include -#endif - -/* Qos namespace */ +#include void Ip::Qos::getTosFromServer(const Comm::ConnectionPointer &server, fde *clientFde) === modified file 'src/ipc/Coordinator.cc' --- src/ipc/Coordinator.cc 2014-01-27 05:27:41 +0000 +++ src/ipc/Coordinator.cc 2014-06-02 07:19:35 +0000 @@ -20,9 +20,8 @@ #include "snmp/Request.h" #include "snmp/Response.h" #endif -#if HAVE_ERRNO_H -#include -#endif + +#include CBDATA_NAMESPACED_CLASS_INIT(Ipc, Coordinator); Ipc::Coordinator* Ipc::Coordinator::TheInstance = NULL; === modified file 'src/ipc/StartListening.cc' --- src/ipc/StartListening.cc 2012-09-01 14:38:36 +0000 +++ src/ipc/StartListening.cc 2014-06-02 07:19:35 +0000 @@ -11,9 +11,7 @@ #include "ipc/StartListening.h" #include "tools.h" -#if HAVE_ERRNO_H -#include -#endif +#include Ipc::StartListeningCb::StartListeningCb(): conn(NULL), errNo(0) { === modified file 'src/ipc_win32.cc' --- src/ipc_win32.cc 2013-06-03 14:05:16 +0000 +++ src/ipc_win32.cc 2014-06-02 07:19:35 +0000 @@ -43,13 +43,11 @@ #include "SquidTime.h" #include "tools.h" +#include #ifndef _MSWSOCK_ #include #endif #include -#if HAVE_ERRNO_H -#include -#endif struct ipc_params { int type; === modified file 'src/log/ModDaemon.cc' --- src/log/ModDaemon.cc 2013-10-25 00:13:46 +0000 +++ src/log/ModDaemon.cc 2014-06-02 07:19:35 +0000 @@ -42,9 +42,7 @@ #include "SquidIpc.h" #include "SquidTime.h" -#if HAVE_ERRNO_H -#include -#endif +#include /* How many buffers to keep before we say we've buffered too much */ #define LOGFILE_MAXBUFS 128 === modified file 'src/log/ModStdio.cc' --- src/log/ModStdio.cc 2012-09-04 09:10:20 +0000 +++ src/log/ModStdio.cc 2014-06-02 07:19:35 +0000 @@ -39,9 +39,7 @@ #include "log/ModStdio.h" #include "SquidConfig.h" -#if HAVE_ERRNO_H -#include -#endif +#include typedef struct { int fd; === modified file 'src/log/ModUdp.cc' --- src/log/ModUdp.cc 2013-06-04 05:12:39 +0000 +++ src/log/ModUdp.cc 2014-06-02 07:19:35 +0000 @@ -40,9 +40,7 @@ #include "Parsing.h" #include "SquidConfig.h" -#if HAVE_ERRNO_H -#include -#endif +#include /* * This logfile UDP module is mostly inspired by a patch by Tim Starling === modified file 'src/main.cc' --- src/main.cc 2014-05-21 17:50:51 +0000 +++ src/main.cc 2014-06-02 07:19:35 +0000 @@ -142,15 +142,13 @@ #include "snmp_core.h" #endif +#include #if HAVE_PATHS_H #include #endif #if HAVE_SYS_WAIT_H #include #endif -#if HAVE_ERRNO_H -#include -#endif #if USE_WIN32_SERVICE #include === modified file 'src/parser/Tokenizer.cc' --- src/parser/Tokenizer.cc 2014-06-02 00:15:10 +0000 +++ src/parser/Tokenizer.cc 2014-06-02 07:19:35 +0000 @@ -1,12 +1,10 @@ #include "squid.h" #include "parser/Tokenizer.h" +#include #if HAVE_CTYPE_H #include #endif -#if HAVE_ERRNO_H -#include -#endif #if HAVE_STDINT_H #include #endif === modified file 'src/ssl/support.cc' --- src/ssl/support.cc 2014-06-02 05:26:17 +0000 +++ src/ssl/support.cc 2014-06-02 07:19:35 +0000 @@ -51,9 +51,7 @@ #include "ssl/support.h" #include "URL.h" -#if HAVE_ERRNO_H -#include -#endif +#include static void setSessionCallbacks(SSL_CTX *ctx); Ipc::MemMap *SslSessionCache = NULL; === modified file 'src/store_rebuild.cc' --- src/store_rebuild.cc 2013-12-30 23:58:33 +0000 +++ src/store_rebuild.cc 2014-06-02 07:19:35 +0000 @@ -44,9 +44,8 @@ #include "StoreSearch.h" #include "SwapDir.h" -#if HAVE_ERRNO_H -#include -#endif +#include + static StoreRebuildData counts; static struct timeval rebuild_start; === modified file 'src/test_cache_digest.cc' --- src/test_cache_digest.cc 2014-04-22 02:47:09 +0000 +++ src/test_cache_digest.cc 2014-06-02 07:19:35 +0000 @@ -38,9 +38,7 @@ #include "CacheDigest.h" #include "store_key_md5.h" -#if HAVE_ERRNO_H -#include -#endif +#include typedef struct { int query_count; === modified file 'src/tools.cc' --- src/tools.cc 2014-03-30 12:00:34 +0000 +++ src/tools.cc 2014-06-02 07:19:35 +0000 @@ -52,6 +52,7 @@ #include "tools.h" #include "wordlist.h" +#include #if HAVE_SYS_PRCTL_H #include #endif @@ -67,9 +68,6 @@ #if HAVE_GRP_H #include #endif -#if HAVE_ERRNO_H -#include -#endif #define DEAD_MSG "\ The Squid Cache (version %s) died.\n\ === modified file 'src/whois.cc' --- src/whois.cc 2013-12-06 23:52:26 +0000 +++ src/whois.cc 2014-06-02 07:19:35 +0000 @@ -43,9 +43,7 @@ #include "Store.h" #include "tools.h" -#if HAVE_ERRNO_H -#include -#endif +#include #define WHOIS_PORT 43