From owner-freebsd-audit Sun Jun 24 22:31:42 2001 Delivered-To: freebsd-audit@freebsd.org Received: from coffee.q9media.com (coffee.q9media.com [216.94.229.19]) by hub.freebsd.org (Postfix) with ESMTP id D793737B405 for ; Sun, 24 Jun 2001 22:31:33 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f5P5iQR91718; Mon, 25 Jun 2001 01:44:26 -0400 (EDT) (envelope-from mike) Date: Mon, 25 Jun 2001 01:44:26 -0400 (EDT) Message-Id: <200106250544.f5P5iQR91718@coffee.q9media.com> To: audit@FreeBSD.org From: Mike Barcroft Subject: src/usr.sbin/spray patch Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I would appreciate it if someone would review and commit the patch at the end of this message. Also available at: http://testbed.q9media.net/freebsd/spray.20010625.patch Best regards, Mike Barcroft ----------------------------------------------------------------------- spray.20010625.patch o Add missing header o Make some ints unsigned to avoid compiler warnings. o Since the prototypes aren't K&R compatible anyway, convert them to ANSI C. o Set WARNS?=2 Index: spray/Makefile =================================================================== RCS file: /home/ncvs/src/usr.sbin/spray/Makefile,v retrieving revision 1.7 diff -u -r1.7 Makefile --- spray/Makefile 2001/03/26 14:41:59 1.7 +++ spray/Makefile 2001/06/25 05:24:11 @@ -1,6 +1,7 @@ # $FreeBSD: src/usr.sbin/spray/Makefile,v 1.7 2001/03/26 14:41:59 ru Exp $ PROG= spray +WARNS?= 2 MAN= spray.8 DPADD= ${LIBRPCSVC} LDADD= -lrpcsvc Index: spray/spray.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/spray/spray.c,v retrieving revision 1.6 diff -u -r1.6 spray.c --- spray/spray.c 2000/05/28 15:05:15 1.6 +++ spray/spray.c 2001/06/25 05:24:12 @@ -33,6 +33,7 @@ "$FreeBSD: src/usr.sbin/spray/spray.c,v 1.6 2000/05/28 15:05:15 charnier Exp $"; #endif /* not lint */ +#include #include #include #include @@ -44,8 +45,8 @@ #define SPRAYOVERHEAD 86 #endif -static void usage (); -void print_xferstats (); +static void usage(void); +static void print_xferstats(int, int, double); /* spray buffer */ char spray_buffer[SPRAYMAX]; @@ -64,8 +65,8 @@ sprayarr host_array; CLIENT *cl; int c; - int i; - int count = 0; + u_int i; + u_int count = 0; int delay = 0; int length = 0; double xmit_time; /* time to receive data */ @@ -186,11 +187,8 @@ } -void -print_xferstats(packets, packetlen, xfertime) - int packets; - int packetlen; - double xfertime; +static void +print_xferstats(int packets, int packetlen, double xfertime) { int datalen; double pps; /* packets per second */ @@ -212,7 +210,7 @@ static void -usage () +usage(void) { fprintf(stderr, "usage: spray [-c count] [-l length] [-d delay] host\n"); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message