misc/72357: WARNS?=5 cleanup for src/tools/tools/netrate
Giorgos Keramidas
keramida at FreeBSD.org
Tue Oct 5 08:40:22 PDT 2004
>Number: 72357
>Category: misc
>Synopsis: WARNS?=5 cleanup for src/tools/tools/netrate
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Tue Oct 05 15:40:21 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator: Giorgos Keramidas
>Release: FreeBSD 6.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD orion.daedalusnetworks.priv 6.0-CURRENT \
FreeBSD 6.0-CURRENT #1: Tue Oct 5 13:10:47 EEST 2004 \
root at xxx:/usr/obj/usr/src/sys/GENERIC i386
>Description:
The attached diff fixes a few warnings in src/tools/tools/netrate
letting both netsend and netreceive build with WARNS=5
>How-To-Repeat:
Build netrate with: make WARNS?=5
>Fix:
--- patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/src/tools/tools/netrate/Makefile,v
retrieving revision 1.2
diff -u -u -r1.2 Makefile
--- Makefile 20 Sep 2004 14:04:00 -0000 1.2
+++ Makefile 5 Oct 2004 15:30:32 -0000
@@ -4,4 +4,6 @@
SUBDIR= netreceive netsend
+WARNS?= 5
+
.include <bsd.subdir.mk>
Index: netsend/netsend.c
===================================================================
RCS file: /home/ncvs/src/tools/tools/netrate/netsend/netsend.c,v
retrieving revision 1.3
diff -u -u -r1.3 netsend.c
--- netsend/netsend.c 21 Sep 2004 20:21:40 -0000 1.3
+++ netsend/netsend.c 5 Oct 2004 15:30:32 -0000
@@ -80,7 +80,7 @@
* 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 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 @@
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");
@@ -190,8 +190,8 @@
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: %ld\n", (send_errors / send_calls));
--- patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list