From: Amos Jeffries Date: Thu, 20 Feb 2014 23:33:29 +0000 (+1300) Subject: Fix compile issues in rev.13288 X-Git-Tag: SQUID_3_5_0_1~356 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b38767c72d5920d11caaf31f9827f5bec8ff9ef3;p=thirdparty%2Fsquid.git Fix compile issues in rev.13288 --- diff --git a/tools/squidclient/Ping.cc b/tools/squidclient/Ping.cc index 286a8a5135..46e5a4c828 100644 --- a/tools/squidclient/Ping.cc +++ b/tools/squidclient/Ping.cc @@ -3,14 +3,13 @@ #include "tools/squidclient/Parameters.h" #include "tools/squidclient/Ping.h" +#include +#include #include #if HAVE_GETOPT_H #include #endif -#if HAVE_SIGNAL_H -#include -#endif namespace Ping { @@ -101,7 +100,7 @@ Ping::TimerStop(size_t fsize) t2s = tv2.tv_sec; tmp = localtime(&t2s); char tbuf[4096]; - snprintf(tbuf, sizeof(tbuf)-1, "%d-%02d-%02d %02d:%02d:%02d [%d]: %ld.%03ld secs, %f KB/s", + snprintf(tbuf, sizeof(tbuf)-1, "%d-%02d-%02d %02d:%02d:%02d [%ld]: %ld.%03ld secs, %f KB/s", tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday, tmp->tm_hour, tmp->tm_min, tmp->tm_sec, stats.counted + 1, elapsed_msec / 1000, elapsed_msec % 1000, @@ -135,7 +134,8 @@ Ping::DisplayStats() { if (Ping::Config.enable && stats.counted) { long mean = stats.sum / stats.counted; - std::cerr << stats.counted << " requests, round-trip (secs) min/avg/max = " + std::cerr << std::endl + << stats.counted << " requests, round-trip (secs) min/avg/max = " << (stats.pMin/1000) << "." << (stats.pMin%1000) << "/" << (mean/1000) << "." << (mean%1000) << "/" << (stats.pMax/1000) << "." << (stats.pMax%1000) diff --git a/tools/squidclient/squidclient.cc b/tools/squidclient/squidclient.cc index 414f97dcfb..dfcdbe851c 100644 --- a/tools/squidclient/squidclient.cc +++ b/tools/squidclient/squidclient.cc @@ -44,6 +44,7 @@ using namespace Squid; /** \endcond */ #endif +#include #include #include @@ -62,9 +63,6 @@ using namespace Squid; #if HAVE_NETDB_H #include #endif -#if HAVE_SIGNAL_H -#include -#endif #if HAVE_ERRNO_H #include #endif @@ -129,8 +127,7 @@ static int client_comm_bind(int, const Ip::Address &); static int client_comm_connect(int, const Ip::Address &); static void usage(const char *progname); -typedef void SIGHDLR(int sig); -SIGHDLR pipe_handler; +void pipe_handler(int sig); static void set_our_signal(void); static ssize_t myread(int fd, void *buf, size_t len); static ssize_t mywrite(int fd, void *buf, size_t len); @@ -229,7 +226,6 @@ main(int argc, char *argv[]) time_t ims = 0; int max_forwards = -1; - int i = 0; const char *proxy_user = NULL; const char *proxy_password = NULL; const char *www_user = NULL; @@ -565,7 +561,7 @@ main(int argc, char *argv[]) uint32_t loops = Ping::Init(); - for (i = 0; loops == 0 || i < loops; ++i) { + for (uint32_t i = 0; loops == 0 || i < loops; ++i) { size_t fsize = 0; struct addrinfo *AI = NULL;