summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorkeramida <keramida@FreeBSD.org>2004-12-21 12:14:34 +0000
committerkeramida <keramida@FreeBSD.org>2004-12-21 12:14:34 +0000
commit1f936587caa85daa51d5e0d4becbd448e36c87f5 (patch)
treef9b19cc5c70e1c22df89205d5e15ae828d2bb565 /tools
parent68c5efb79117c870080d506a71acca2d829a6742 (diff)
downloadFreeBSD-src-1f936587caa85daa51d5e0d4becbd448e36c87f5.zip
FreeBSD-src-1f936587caa85daa51d5e0d4becbd448e36c87f5.tar.gz
Fix the build of netrate/ with WARNS=5 and add a Makefile.inc to
make it the default for all the netrate test tools. Approved by: rwatson
Diffstat (limited to 'tools')
-rw-r--r--tools/tools/netrate/Makefile.inc4
-rw-r--r--tools/tools/netrate/netsend/netsend.c12
2 files changed, 10 insertions, 6 deletions
diff --git a/tools/tools/netrate/Makefile.inc b/tools/tools/netrate/Makefile.inc
new file mode 100644
index 0000000..3b1228c
--- /dev/null
+++ b/tools/tools/netrate/Makefile.inc
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+WARNS?= 5
+WFORMAT?= 2
diff --git a/tools/tools/netrate/netsend/netsend.c b/tools/tools/netrate/netsend/netsend.c
index 2406d41..66359eb 100644
--- a/tools/tools/netrate/netsend/netsend.c
+++ b/tools/tools/netrate/netsend/netsend.c
@@ -80,7 +80,7 @@ timespec_ge(struct timespec *a, struct timespec *b)
* to the caller. Optionally also increment a counter provided by the
* caller each time we loop.
*/
-int
+static int
wait_time(struct timespec ts, struct timespec *wakeup_ts, long long *waited)
{
struct timespec curtime;
@@ -114,7 +114,7 @@ wait_time(struct timespec ts, struct timespec *wakeup_ts, long long *waited)
* wait between our calculated interval and dropping the provided packet
* into the socket. If we hit our duration limit, bail.
*/
-int
+static int
timing_loop(int s, struct timespec interval, long duration, u_char *packet,
u_int packet_len)
{
@@ -122,7 +122,7 @@ timing_loop(int s, struct timespec interval, long duration, u_char *packet,
long long waited;
u_int32_t counter;
long finishtime;
- int send_errors, send_calls;
+ long send_errors, send_calls;
if (clock_getres(CLOCK_REALTIME, &tmptime) == -1) {
perror("clock_getres");
@@ -188,11 +188,11 @@ done:
starttime.tv_nsec);
printf("finish: %d.%09lu\n", tmptime.tv_sec,
tmptime.tv_nsec);
- printf("send calls: %d\n", send_calls);
- printf("send errors: %d\n", send_errors);
+ printf("send calls: %ld\n", send_calls);
+ printf("send errors: %ld\n", send_errors);
printf("approx send rate: %ld\n", (send_calls - send_errors) /
duration);
- printf("approx error rate: %d\n", (send_errors / send_calls));
+ printf("approx error rate: %ld\n", (send_errors / send_calls));
printf("waited: %lld\n", waited);
printf("approx waits/sec: %lld\n", waited / duration);
printf("approx wait rate: %lld\n", waited / send_calls);
OpenPOWER on IntegriCloud