HAWQ-933. Warning fix for gpnetbench.
Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/9bdad43e Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/9bdad43e Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/9bdad43e Branch: refs/heads/2.0.0.0-incubating Commit: 9bdad43ebbbcefce23db193c3a7dd62ea6a3d805 Parents: ed443c1 Author: xunzhang <xunzhang...@gmail.com> Authored: Tue Jul 19 09:49:38 2016 +0800 Committer: rlei <r...@pivotal.io> Committed: Tue Jul 19 10:50:00 2016 +0800 ---------------------------------------------------------------------- tools/gpnetbench/gpnetbenchClient.c | 36 +++++++++++++++++--------------- tools/gpnetbench/gpnetbenchServer.c | 10 +++++---- 2 files changed, 25 insertions(+), 21 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/9bdad43e/tools/gpnetbench/gpnetbenchClient.c ---------------------------------------------------------------------- diff --git a/tools/gpnetbench/gpnetbenchClient.c b/tools/gpnetbench/gpnetbenchClient.c index d95f8a9..4669d16 100644 --- a/tools/gpnetbench/gpnetbenchClient.c +++ b/tools/gpnetbench/gpnetbenchClient.c @@ -29,25 +29,11 @@ #include <sys/time.h> #define INIT_RETRIES 5 +void usage(void); void send_buffer(int fd, char* buffer, int bytes); -void print_headers(); +void print_headers(void); double subtractTimeOfDay(struct timeval* begin, struct timeval* end); -void usage() -{ - fprintf(stdout, "usage: gpnetbench -p PORT -H HOST [-l SECONDS] [-t EXPERIMENT] [-f UNITS] [-P HEADERS] [-b KB] [-h]\n"); - fprintf(stdout, "where\n"); - fprintf(stdout, " PORT is the port to connect to for the server\n"); - fprintf(stdout, " HOST is the hostname to connect to for the server\n"); - fprintf(stdout, " SECONDS is the number of seconds to sample the network, where the default is 60\n"); - fprintf(stdout, " EXPERIMENT is the experiment name to run, where the default is TCP_STREAM\n"); - fprintf(stdout, " UNITS is the output units, where the default is M megabytes\n"); - fprintf(stdout, " HEADERS is 0 (don't) or 1 (do) display headers in the output\n"); - fprintf(stdout, " KB is the size of the send buffer in kilobytes, where the default is 32\n"); - - fprintf(stdout, " -h shows this help message\n"); -} - int main(int argc, char** argv) { int socketFd; @@ -188,9 +174,24 @@ int main(int argc, char** argv) return 0; } +void usage() +{ + fprintf(stdout, "usage: gpnetbench -p PORT -H HOST [-l SECONDS] [-t EXPERIMENT] [-f UNITS] [-P HEADERS] [-b KB] [-h]\n"); + fprintf(stdout, "where\n"); + fprintf(stdout, " PORT is the port to connect to for the server\n"); + fprintf(stdout, " HOST is the hostname to connect to for the server\n"); + fprintf(stdout, " SECONDS is the number of seconds to sample the network, where the default is 60\n"); + fprintf(stdout, " EXPERIMENT is the experiment name to run, where the default is TCP_STREAM\n"); + fprintf(stdout, " UNITS is the output units, where the default is M megabytes\n"); + fprintf(stdout, " HEADERS is 0 (don't) or 1 (do) display headers in the output\n"); + fprintf(stdout, " KB is the size of the send buffer in kilobytes, where the default is 32\n"); + + fprintf(stdout, " -h shows this help message\n"); +} + void send_buffer(int fd, char* buffer, int bytes) { - size_t retval; + ssize_t retval; while(bytes > 0) { @@ -235,3 +236,4 @@ void print_headers() printf(" Size Time Throughput\n"); printf("n/a n/a bytes secs. MBytes/sec\n"); } + http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/9bdad43e/tools/gpnetbench/gpnetbenchServer.c ---------------------------------------------------------------------- diff --git a/tools/gpnetbench/gpnetbenchServer.c b/tools/gpnetbench/gpnetbenchServer.c index abe1afd..e25c13b 100644 --- a/tools/gpnetbench/gpnetbenchServer.c +++ b/tools/gpnetbench/gpnetbenchServer.c @@ -31,10 +31,7 @@ char* receiveBuffer = NULL; void handleIncomingConnection(int fd); -void usage() -{ - fprintf(stdout, "usage: gpnetbenchServer -p PORT [-h]\n"); -} +void usage(void); int main(int argc, char** argv) { @@ -149,6 +146,11 @@ int main(int argc, char** argv) return 0; } +void usage() +{ + fprintf(stdout, "usage: gpnetbenchServer -p PORT [-h]\n"); +} + void handleIncomingConnection(int fd) { ssize_t bytes;