From ac9ee76c8aa0d5b12a79890165bc683ac65825f0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 22 Aug 2008 08:18:40 +1000 Subject: [PATCH] use 64bit counter --- socklib/sock_sink.c | 3 ++- socklib/sock_source.c | 2 +- socklib/socklib.c | 2 +- socklib/socklib.h | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/socklib/sock_sink.c b/socklib/sock_sink.c index ff349cd..2acf3a3 100644 --- a/socklib/sock_sink.c +++ b/socklib/sock_sink.c @@ -8,7 +8,8 @@ static char *host="127.0.0.1"; static void sender(void) { - int fd, total=0; + int fd; + uint64_t total=0; char *buf; fd = open_socket_out(host, port); diff --git a/socklib/sock_source.c b/socklib/sock_source.c index e3efc50..59104a4 100644 --- a/socklib/sock_source.c +++ b/socklib/sock_source.c @@ -41,7 +41,7 @@ static int do_write(int fd, const char *buf, size_t size) static void server(int fd) { char *buf; - int total=0; + uint64_t total=0; signal(SIGPIPE, SIG_IGN); diff --git a/socklib/socklib.c b/socklib/socklib.c index 09ab796..f8d11ca 100644 --- a/socklib/socklib.c +++ b/socklib/socklib.c @@ -242,7 +242,7 @@ double end_timer() (tp2.tv_usec - tp1.tv_usec)*1.0e-6); } -void report_time(int total) +void report_time(uint64_t total) { printf("%.6g MB/sec\n", (total/(1.0e6))/end_timer()); } diff --git a/socklib/socklib.h b/socklib/socklib.h index 43c8876..34ab669 100644 --- a/socklib/socklib.h +++ b/socklib/socklib.h @@ -26,7 +26,7 @@ int open_socket_in(int type, int port, uint32 socket_addr); int open_socket_out(char *host, int port); double end_timer(); -void report_time(int total); +void report_time(uint64_t total); void start_timer(); void set_socket_options(int fd, char *options); -- 2.34.1