#include "tools/squidclient/Parameters.h"
#include "tools/squidclient/Ping.h"
+#include <climits>
+#include <csignal>
#include <iostream>
#if HAVE_GETOPT_H
#include <getopt.h>
#endif
-#if HAVE_SIGNAL_H
-#include <signal.h>
-#endif
namespace Ping
{
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,
{
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)
/** \endcond */
#endif
+#include <csignal>
#include <cstdio>
#include <iostream>
#if HAVE_NETDB_H
#include <netdb.h>
#endif
-#if HAVE_SIGNAL_H
-#include <signal.h>
-#endif
#if HAVE_ERRNO_H
#include <errno.h>
#endif
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);
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;
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;