From: Amos Jeffries Date: Thu, 25 Mar 2010 08:27:46 +0000 (-0600) Subject: Compat: Shuffle final squid.h hacks into libcompat X-Git-Tag: SQUID_3_2_0_1~328 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef364f64c19b7f90fa9163d89e70f32a5653b0ca;p=thirdparty%2Fsquid.git Compat: Shuffle final squid.h hacks into libcompat --- diff --git a/compat/compat_shared.h b/compat/compat_shared.h index 753396e38e..92ac7b116a 100644 --- a/compat/compat_shared.h +++ b/compat/compat_shared.h @@ -194,4 +194,15 @@ extern "C" { #endif #endif + +/* Apparently the IPPROTO_ are not always defined either... */ +/* TODO: find out what OS require these and define specifically for them. */ +#ifndef IPPROTO_UDP +#define IPPROTO_UDP 0 +#endif +#ifndef IPPROTO_TCP +#define IPPROTO_TCP 0 +#endif + + #endif /* _SQUID_COMPAT_SHARED_H */ diff --git a/compat/os/solaris.h b/compat/os/solaris.h index e159e8545f..4bf7f29222 100644 --- a/compat/os/solaris.h +++ b/compat/os/solaris.h @@ -30,7 +30,9 @@ typedef union { /** * prototypes for system function missing from system includes + * NP: sys/resource.h and sys/time.h are apparently order-dependant. */ +#include #include SQUIDCEXTERN int getrusage(int, struct rusage *); diff --git a/configure.in b/configure.in index 6e2edbc213..13ce8cc249 100644 --- a/configure.in +++ b/configure.in @@ -4037,6 +4037,14 @@ if test "$ac_cv_needs_sys_errlist" = "yes" ; then AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external]) fi +dnl Hurd does not supply MAXPATHLEN. we may need to define it outselves. +dnl Other system define it in system headers +AC_CHECK_HEADERS([sys/param.h]) +AC_MSG_CHECKING(for MAXPATHLEN) +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]],[[int i = MAXPATHLEN;]])],[AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no) + AC_DEFINE(MAXPATHLEN,256,[If MAXPATHLEN has not been defined])]) + + dnl Not cached since people are likely to change this AC_MSG_CHECKING(for libresolv _dns_ttl_ hack) AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern int _dns_ttl_;]], [[return _dns_ttl_;]])],[AC_MSG_RESULT(yes) diff --git a/helpers/basic_auth/RADIUS/basic_radius_auth.cc b/helpers/basic_auth/RADIUS/basic_radius_auth.cc index 0320c9321d..51fc29c50a 100644 --- a/helpers/basic_auth/RADIUS/basic_radius_auth.cc +++ b/helpers/basic_auth/RADIUS/basic_radius_auth.cc @@ -50,18 +50,12 @@ #include "radius.h" #include "radius-util.h" -#if HAVE_SYS_TYPES_H -#include -#endif #if HAVE_SYS_SOCKET_H #include #endif #if HAVE_NETINET_IN_H #include #endif -#if HAVE_SYS_TIME_H -#include -#endif #if HAVE_UNISTD_H #include #endif @@ -86,9 +80,6 @@ #if HAVE_PWD_H #include #endif -#if HAVE_STDLIB_H -#include -#endif #if HAVE_TIME_H #include #endif diff --git a/helpers/basic_auth/RADIUS/radius-util.cc b/helpers/basic_auth/RADIUS/radius-util.cc index 4388dcc96e..d040766be6 100644 --- a/helpers/basic_auth/RADIUS/radius-util.cc +++ b/helpers/basic_auth/RADIUS/radius-util.cc @@ -38,15 +38,9 @@ char util_sccsid[] = #include "config.h" -#if HAVE_SYS_TYES_H -#include -#endif #if HAVE_SYS_SOCKET_H #include #endif -#if HAVE_SYS_TIME_H -#include -#endif #if HAVE_NETINET_IN_H #include #endif @@ -54,9 +48,6 @@ char util_sccsid[] = #if HAVE_STDIO_H #include #endif -#if HAVE_STDLIB_H -#include -#endif #if HAVE_NETDB_H #include #endif diff --git a/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth.cc b/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth.cc index 5f84ea41f8..015f894db9 100644 --- a/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth.cc +++ b/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth.cc @@ -41,9 +41,6 @@ #if HAVE_STDOI_H #include #endif -#if HAVE_STDLIB_H -#include -#endif #if HAVE_NETDB_H #include #endif @@ -53,9 +50,6 @@ #if HAVE_TIME_H #include #endif -#if HAVE_SYS_TIME_H -#include -#endif #include "util.h" #include "base64.h" diff --git a/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth_test.cc b/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth_test.cc index f15ebb515c..56c75252cb 100644 --- a/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth_test.cc +++ b/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth_test.cc @@ -35,9 +35,6 @@ #if HAVE_STDIO_H #include #endif -#if HAVE_STDLIB_H -#include -#endif #if HAVE_NETDB_H #include #endif @@ -47,9 +44,6 @@ #if HAVE_TIME_H #include #endif -#if HAVE_SYS_TIME_H -#include -#endif #if HAVE_ERRNO_H #include #endif diff --git a/helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.h b/helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.h index bfb296760c..52b08e9637 100644 --- a/helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.h +++ b/helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.h @@ -25,9 +25,6 @@ #if HAVE_TIME_H #include #endif -#if HAVE_SYS_TIME_H -#include -#endif /************* CONFIGURATION ***************/ /* diff --git a/include/profiling.h b/include/profiling.h index bd9d489c13..730303144c 100644 --- a/include/profiling.h +++ b/include/profiling.h @@ -13,8 +13,6 @@ class CacheManager; #if !_SQUID_SOLARIS_ typedef int64_t hrtime_t; -#else -#include #endif #if defined(__GNUC__) && ( defined(__i386) || defined(__i386__) ) diff --git a/include/snmp_api.h b/include/snmp_api.h index 7614c4fd06..da69dbfd9e 100644 --- a/include/snmp_api.h +++ b/include/snmp_api.h @@ -1,14 +1,7 @@ -/* - * $Id$ - */ - #ifndef SQUID_SNMP_API_H #define SQUID_SNMP_API_H #include "config.h" -#ifdef HAVE_SYS_TIME_H -#include -#endif /*********************************************************** Copyright 1989 by Carnegie Mellon University diff --git a/include/strnstr.h b/include/strnstr.h index bb3dc01ffc..63724a1997 100644 --- a/include/strnstr.h +++ b/include/strnstr.h @@ -1,11 +1,8 @@ -/* - * Squid VCS $Id$ - */ #include "config.h" #if HAVE_STRNSTR -/* Is strnstr exists and is usablewe do so. */ +/* Is strnstr exists and is usable we do so. */ #define squid_strnstr(a,b,c) strnstr(a,b,c) #else /* not HAVE_STRNSTR */ diff --git a/include/util.h b/include/util.h index f02e042435..cebd0594bd 100644 --- a/include/util.h +++ b/include/util.h @@ -42,17 +42,10 @@ #if HAVE_TIME_H #include #endif -#if HAVE_SYS_TIME_H -#include -#endif #if HAVE_ARPA_INET_H #include #endif -#if defined(_SQUID_FREEBSD_) -#define _etext etext -#endif - SQUIDCEXTERN const char *mkhttpdlogtime(const time_t *); SQUIDCEXTERN const char *mkrfc1123(time_t); SQUIDCEXTERN char *uudecode(const char *); diff --git a/lib/iso3307.c b/lib/iso3307.c index c7bc33d94d..1d1491bd61 100644 --- a/lib/iso3307.c +++ b/lib/iso3307.c @@ -1,7 +1,3 @@ -/* - * $Id$ - */ - #include "config.h" #include "util.h" @@ -14,15 +10,9 @@ #if HAVE_CTYPE_H #include #endif -#if HAVE_SYS_TYPES_H -#include -#endif #if HAVE_TIME_H #include #endif -#if HAVE_SYS_TIME_H -#include -#endif #define ASCII_DIGIT(c) ((c)-48) diff --git a/lib/rfc1035.c b/lib/rfc1035.c index fb5635d21c..e960855070 100644 --- a/lib/rfc1035.c +++ b/lib/rfc1035.c @@ -1,4 +1,3 @@ - /* * $Id$ * @@ -48,15 +47,9 @@ #if HAVE_UNISTD_H #include #endif -#if HAVE_STDLIB_H -#include -#endif #if HAVE_MEMORY_H #include #endif -#if HAVE_SYS_TYPES_H -#include -#endif #if HAVE_ASSERT_H #include #endif @@ -742,7 +735,6 @@ rfc1035SetQueryID(char *buf, unsigned short qid) #if DRIVER #include -#include int main(int argc, char *argv[]) { diff --git a/lib/rfc1123.c b/lib/rfc1123.c index dd98d360ae..7350e3d886 100644 --- a/lib/rfc1123.c +++ b/lib/rfc1123.c @@ -1,4 +1,3 @@ - /* * $Id$ * @@ -43,25 +42,15 @@ #if HAVE_STDIO_H #include #endif -#if HAVE_STDLIB_H -#include -#endif #if HAVE_STRING_H #include #endif #if HAVE_CTYPE_H #include #endif -#if HAVE_SYS_TYPES_H -#include -#endif #if HAVE_TIME_H #include #endif -#if HAVE_SYS_TIME_H -#include -#endif - #include "util.h" #define RFC850_STRFTIME "%A, %d-%b-%y %H:%M:%S GMT" diff --git a/lib/rfc3596.c b/lib/rfc3596.c index ab93de9fc8..fba04e311e 100644 --- a/lib/rfc3596.c +++ b/lib/rfc3596.c @@ -1,4 +1,3 @@ - /* * $Id$ * @@ -66,15 +65,9 @@ #if HAVE_UNISTD_H #include #endif -#if HAVE_STDLIB_H -#include -#endif #if HAVE_MEMORY_H #include #endif -#if HAVE_SYS_TYPES_H -#include -#endif #if HAVE_ASSERT_H #include #endif @@ -210,7 +203,6 @@ rfc3596BuildPTRQuery6(const struct in6_addr addr, char *buf, size_t sz, unsigned # undef main(a,b) #include -#include int main(int argc, char *argv[]) diff --git a/lib/xusleep.c b/lib/xusleep.c index 91d88dedc5..8de597ab86 100644 --- a/lib/xusleep.c +++ b/lib/xusleep.c @@ -5,9 +5,6 @@ #if HAVE_UNISTD_H #include #endif -#if HAVE_SYS_TIME_H -#include -#endif /** * xusleep, as usleep but accepts longer pauses diff --git a/src/PingData.h b/src/PingData.h index bca2e1c859..50caacf011 100644 --- a/src/PingData.h +++ b/src/PingData.h @@ -35,10 +35,6 @@ #include "config.h" -#ifdef HAVE_SYS_TIME_H -#include -#endif - class ping_data { diff --git a/src/SquidTime.h b/src/SquidTime.h index b9a3d43f40..411bcfd072 100644 --- a/src/SquidTime.h +++ b/src/SquidTime.h @@ -37,10 +37,7 @@ #if HAVE_TIME_H #include #endif -#if HAVE_SYS_TIME_H -#include -#endif - +/* NP: sys/time.h is provided by libcompat */ /* globals for accessing time */ extern struct timeval current_time; diff --git a/src/dnsserver.cc b/src/dnsserver.cc index a5a40b2df7..441815d498 100644 --- a/src/dnsserver.cc +++ b/src/dnsserver.cc @@ -76,12 +76,6 @@ #if HAVE_SYS_PARAM_H #include #endif -#if HAVE_SYS_TIME_H -#include -#endif -#if HAVE_SYS_RESOURCE_H -#include /* needs sys/time.h above it */ -#endif #if HAVE_SYS_SOCKET_H #include #endif diff --git a/src/fde.h b/src/fde.h index a0b903d1a3..a56148eab7 100644 --- a/src/fde.h +++ b/src/fde.h @@ -128,4 +128,7 @@ private: SQUIDCEXTERN int fdNFree(void); +#define FD_READ_METHOD(fd, buf, len) (*fd_table[fd].read_method)(fd, buf, len) +#define FD_WRITE_METHOD(fd, buf, len) (*fd_table[fd].write_method)(fd, buf, len) + #endif /* SQUID_FDE_H */ diff --git a/src/fs/coss/store_dir_coss.cc b/src/fs/coss/store_dir_coss.cc index 959334d0a1..bda27c7f05 100644 --- a/src/fs/coss/store_dir_coss.cc +++ b/src/fs/coss/store_dir_coss.cc @@ -91,13 +91,13 @@ static FILE *storeCossDirOpenTmpSwapLog(CossSwapDir *, int *, int *); static char * storeCossDirSwapLogFile(SwapDir * sd, const char *ext) { - LOCAL_ARRAY(char, path, SQUID_MAXPATHLEN); - LOCAL_ARRAY(char, pathtmp, SQUID_MAXPATHLEN); + LOCAL_ARRAY(char, path, MAXPATHLEN); + LOCAL_ARRAY(char, pathtmp, MAXPATHLEN); LOCAL_ARRAY(char, digit, 32); char *pathtmp2; if (Config.Log.swap) { - xstrncpy(pathtmp, sd->path, SQUID_MAXPATHLEN - 64); + xstrncpy(pathtmp, sd->path, MAXPATHLEN - 64); pathtmp2 = pathtmp; while ((pathtmp2 = strchr(pathtmp2, '/')) != NULL) @@ -107,15 +107,15 @@ storeCossDirSwapLogFile(SwapDir * sd, const char *ext) pathtmp[strlen(pathtmp) - 1] = '\0'; for (pathtmp2 = pathtmp; *pathtmp2 == '.'; pathtmp2++); - snprintf(path, SQUID_MAXPATHLEN - 64, Config.Log.swap, pathtmp2); + snprintf(path, MAXPATHLEN - 64, Config.Log.swap, pathtmp2); - if (strncmp(path, Config.Log.swap, SQUID_MAXPATHLEN - 64) == 0) { + if (strncmp(path, Config.Log.swap, MAXPATHLEN - 64) == 0) { strcat(path, "."); snprintf(digit, 32, "%02d", sd->index); strncat(path, digit, 3); } } else { - xstrncpy(path, sd->path, SQUID_MAXPATHLEN - 64); + xstrncpy(path, sd->path, MAXPATHLEN - 64); strcat(path, "/swap.state"); } diff --git a/src/fs/ufs/store_dir_ufs.cc b/src/fs/ufs/store_dir_ufs.cc index e4f95ebde2..8f86832499 100644 --- a/src/fs/ufs/store_dir_ufs.cc +++ b/src/fs/ufs/store_dir_ufs.cc @@ -484,9 +484,9 @@ UFSSwapDir::mapBitAllocate() char * UFSSwapDir::swapSubDir(int subdirn)const { - LOCAL_ARRAY(char, fullfilename, SQUID_MAXPATHLEN); + LOCAL_ARRAY(char, fullfilename, MAXPATHLEN); assert(0 <= subdirn && subdirn < l1); - snprintf(fullfilename, SQUID_MAXPATHLEN, "%s/%02X", path, subdirn); + snprintf(fullfilename, MAXPATHLEN, "%s/%02X", path, subdirn); return fullfilename; } @@ -589,13 +589,13 @@ UFSSwapDir::createSwapSubDirs() char * UFSSwapDir::logFile(char const *ext) const { - LOCAL_ARRAY(char, lpath, SQUID_MAXPATHLEN); - LOCAL_ARRAY(char, pathtmp, SQUID_MAXPATHLEN); + LOCAL_ARRAY(char, lpath, MAXPATHLEN); + LOCAL_ARRAY(char, pathtmp, MAXPATHLEN); LOCAL_ARRAY(char, digit, 32); char *pathtmp2; if (Config.Log.swap) { - xstrncpy(pathtmp, path, SQUID_MAXPATHLEN - 64); + xstrncpy(pathtmp, path, MAXPATHLEN - 64); pathtmp2 = pathtmp; while ((pathtmp2 = strchr(pathtmp2, '/')) != NULL) @@ -605,15 +605,15 @@ UFSSwapDir::logFile(char const *ext) const pathtmp[strlen(pathtmp) - 1] = '\0'; for (pathtmp2 = pathtmp; *pathtmp2 == '.'; pathtmp2++); - snprintf(lpath, SQUID_MAXPATHLEN - 64, Config.Log.swap, pathtmp2); + snprintf(lpath, MAXPATHLEN - 64, Config.Log.swap, pathtmp2); - if (strncmp(lpath, Config.Log.swap, SQUID_MAXPATHLEN - 64) == 0) { + if (strncmp(lpath, Config.Log.swap, MAXPATHLEN - 64) == 0) { strcat(lpath, "."); snprintf(digit, 32, "%02d", index); strncat(lpath, digit, 3); } } else { - xstrncpy(lpath, path, SQUID_MAXPATHLEN - 64); + xstrncpy(lpath, path, MAXPATHLEN - 64); strcat(lpath, "/swap.state"); } @@ -1087,7 +1087,7 @@ UFSSwapDir::DirClean(int swap_index) D1 = (swap_index / N0) % N1; N2 = SD->l2; D2 = ((swap_index / N0) / N1) % N2; - snprintf(p1, SQUID_MAXPATHLEN, "%s/%02X/%02X", + snprintf(p1, MAXPATHLEN, "%s/%02X/%02X", SD->path, D1, D2); debugs(36, 3, "storeDirClean: Cleaning directory " << p1); dir_pointer = opendir(p1); @@ -1336,7 +1336,7 @@ UFSSwapDir::dump(StoreEntry & entry) const char * UFSSwapDir::fullPath(sfileno filn, char *fullpath) const { - LOCAL_ARRAY(char, fullfilename, SQUID_MAXPATHLEN); + LOCAL_ARRAY(char, fullfilename, MAXPATHLEN); int L1 = l1; int L2 = l2; @@ -1345,7 +1345,7 @@ UFSSwapDir::fullPath(sfileno filn, char *fullpath) const fullpath[0] = '\0'; - snprintf(fullpath, SQUID_MAXPATHLEN, "%s/%02X/%02X/%08X", + snprintf(fullpath, MAXPATHLEN, "%s/%02X/%02X/%08X", path, ((filn / L2) / L2) % L1, (filn / L2) % L2, diff --git a/src/fs/ufs/ufscommon.cc b/src/fs/ufs/ufscommon.cc index d994e97d0a..686ab35bf5 100644 --- a/src/fs/ufs/ufscommon.cc +++ b/src/fs/ufs/ufscommon.cc @@ -702,7 +702,7 @@ RebuildState::getNextFile(sfileno * filn_p, int *size) } if (0 == in_dir) { /* we need to read in a new directory */ - snprintf(fullpath, SQUID_MAXPATHLEN, "%s/%02X/%02X", + snprintf(fullpath, MAXPATHLEN, "%s/%02X/%02X", sd->path, curlvl1, curlvl2); @@ -747,7 +747,7 @@ RebuildState::getNextFile(sfileno * filn_p, int *size) continue; } - snprintf(fullfilename, SQUID_MAXPATHLEN, "%s/%s", + snprintf(fullfilename, MAXPATHLEN, "%s/%s", fullpath, entry->d_name); debugs(47, 3, "commonUfsDirGetNextFile: Opening " << fullfilename); fd = file_open(fullfilename, O_RDONLY | O_BINARY); diff --git a/src/fs/ufs/ufscommon.h b/src/fs/ufs/ufscommon.h index 815e3b2d64..ad313e9e07 100644 --- a/src/fs/ufs/ufscommon.h +++ b/src/fs/ufs/ufscommon.h @@ -401,8 +401,8 @@ public: struct dirent *entry; DIR *td; - char fullpath[SQUID_MAXPATHLEN]; - char fullfilename[SQUID_MAXPATHLEN]; + char fullpath[MAXPATHLEN]; + char fullfilename[MAXPATHLEN]; struct _store_rebuild_data counts; diff --git a/src/log/File.h b/src/log/File.h index 4d98e2fd78..56b690e43e 100644 --- a/src/log/File.h +++ b/src/log/File.h @@ -4,6 +4,10 @@ #include "config.h" #include "dlink.h" +#if HAVE_SYS_PARAM_H +#include +#endif + class logfile_buffer_t { public: @@ -27,7 +31,7 @@ class Logfile { public: - char path[SQUID_MAXPATHLEN]; + char path[MAXPATHLEN]; struct { unsigned int fatal; diff --git a/src/main.cc b/src/main.cc index 255528623c..57d329a37a 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1455,7 +1455,7 @@ sendSignal(void) static void mainStartScript(const char *prog) { - char script[SQUID_MAXPATHLEN]; + char script[MAXPATHLEN]; char *t; size_t sl = 0; pid_t cpid; diff --git a/src/structs.h b/src/structs.h index 25c87fad81..ab31438a0e 100644 --- a/src/structs.h +++ b/src/structs.h @@ -512,6 +512,10 @@ struct SquidConfig { int n_allocated; int n_configured; } cacheSwap; +/* + * I'm sick of having to keep doing this .. + */ +#define INDEXSD(i) (Config.cacheSwap.swapDirs[(i)].getRaw()) struct { char *directory; diff --git a/test-suite/hash.c b/test-suite/hash.c index f69dc0b1c3..1dad26882a 100644 --- a/test-suite/hash.c +++ b/test-suite/hash.c @@ -32,16 +32,26 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * */ +#include "config.h" +#if HAVE_UNISTD_H #include -#include +#endif +#if HAVE_STDIO_H #include -#include +#endif +#if HAVE_CTYPE_H #include -#include +#endif +#if HAVE_STRINGS_H #include +#endif +#if HAVE_ASSERT_H #include +#endif + #include "hash.h" + #undef free extern void my_free(char *, int, void *); diff --git a/test-suite/membanger.c b/test-suite/membanger.c index 9c032e7f76..77eddbddcd 100644 --- a/test-suite/membanger.c +++ b/test-suite/membanger.c @@ -1,14 +1,18 @@ +#include "config.h" +#include "hash.h" + +#if HAVE_UNISTD_H #include -#include +#endif +#if HAVE_STDIO_H #include -#include +#endif +#if HAVE_CTYPE_H #include -#include +#endif +#if HAVE_STRINGS_H #include -#include -#include - -#include "hash.h" +#endif static hash_table *mem_table = NULL; static hash_link *mem_entry; diff --git a/test-suite/pconn-banger.c b/test-suite/pconn-banger.c index 93345dbc64..0527d06627 100644 --- a/test-suite/pconn-banger.c +++ b/test-suite/pconn-banger.c @@ -25,9 +25,6 @@ #if HAVE_TIME_H #include #endif -#if HAVE_SYS_TIME_H -#include -#endif #if HAVE_SYS_SOCKET_H #include #endif diff --git a/test-suite/tcp-banger2.c b/test-suite/tcp-banger2.c index e6acd1a02d..d3072c4379 100644 --- a/test-suite/tcp-banger2.c +++ b/test-suite/tcp-banger2.c @@ -54,9 +54,6 @@ #if HAVE_TIME_H #include #endif -#if HAVE_SYS_TIME_H -#include -#endif #if HAVE_SYS_SOCKET_H #include #endif diff --git a/test-suite/tcp-banger3.c b/test-suite/tcp-banger3.c index cb15886fb1..79c3470688 100644 --- a/test-suite/tcp-banger3.c +++ b/test-suite/tcp-banger3.c @@ -52,9 +52,6 @@ #if HAVE_TIME_H #include #endif -#if HAVE_SYS_TIME_H -#include -#endif #if HAVE_SYS_SOCKET_H #include #endif @@ -73,8 +70,12 @@ #if HAVE_ASSERT_H #include #endif +#if HAVE_NETDB_H #include +#endif +#if HAVE_SYS_WAIT_H #include +#endif #define READ_BUF_SZ 4096 #define URL_BUF_SZ 4096 diff --git a/test-suite/waiter.c b/test-suite/waiter.c index 5a3b39e630..770fa09956 100644 --- a/test-suite/waiter.c +++ b/test-suite/waiter.c @@ -1,5 +1,8 @@ -#include +#include "config.h" + +#if HAVE_ASSERT_H #include +#endif int main(int argc, char *argv[]) diff --git a/tools/cachemgr.cc b/tools/cachemgr.cc index 98a600b94a..34e8b2c3b4 100644 --- a/tools/cachemgr.cc +++ b/tools/cachemgr.cc @@ -75,12 +75,6 @@ #if HAVE_SYS_PARAM_H #include #endif -#if HAVE_SYS_TIME_H -#include -#endif -#if HAVE_SYS_RESOURCE_H -#include /* needs sys/time.h above it */ -#endif #if HAVE_SYS_SOCKET_H #include #endif