From: Robert W. <ro...@us...> - 2003-03-14 16:39:58
|
Applied to CVS tree. - Robbie Robert V. Williamson <ro...@us...> Linux Test Project IBM Linux Technology Center Phone: (512) 838-9295 T/L: 678-9295 Fax: (512) 838-4603 Web: http://ltp.sourceforge.net IRC: #ltp on freenode.irc.net ==================== "Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." -Albert Einstein Andreas Jaeger <aj...@su...> To: ltp...@li... Sent by: cc: ltp...@li...ur Subject: [LTP] cleanup netpipe ceforge.net 03/14/2003 04:15 AM This fixes most of the warnings in netpipe. Andreas ============================================================ Index: tools/netpipe-2.4/netpipe.h --- tools/netpipe-2.4/netpipe.h 5 Feb 2003 15:44:54 -0000 1.1 +++ tools/netpipe-2.4/netpipe.h 14 Mar 2003 10:14:43 -0000 @@ -24,6 +24,7 @@ #ifdef HAVE_GETRUSAGE #include <sys/resource.h> #endif +#include <unistd.h> #define DEFPORT 5002 @@ -83,6 +84,8 @@ struct data }; double When(); + +void PrintUsage(void); int Setup(ArgStruct *p); ============================================================ Index: tools/netpipe-2.4/netpipe.c --- tools/netpipe-2.4/netpipe.c 5 Feb 2003 15:44:54 -0000 1.1 +++ tools/netpipe-2.4/netpipe.c 14 Mar 2003 10:14:43 -0000 @@ -27,6 +27,7 @@ static const char rcsid[] = "$Id: netpipe.c,v 1.1 2003/02/05 15:44:54 robbiew Exp $"; #endif +int main(int argc, char *argv[]) { FILE *out; /* Output data file */ @@ -513,7 +514,8 @@ When() return ((double) tp.tv_sec + (double) tp.tv_usec * 1e-6); } -PrintUsage() +void +PrintUsage(void) { printf("\n NETPIPE USAGE \n\n"); printf("A: specify buffers alignment e.g.: <-A 1024>\n"); ============================================================ Index: tools/netpipe-2.4/TCP.c --- tools/netpipe-2.4/TCP.c 5 Feb 2003 15:44:54 -0000 1.1 +++ tools/netpipe-2.4/TCP.c 14 Mar 2003 10:14:43 -0000 @@ -22,7 +22,6 @@ int Setup(ArgStruct *p) { int tr, one = 1; /* tr==1 if process is a transmitter */ - short port; int sockfd; struct sockaddr_in *lsin1, *lsin2; /* ptr to sockaddr_in in ArgStruct */ char *host; @@ -64,13 +63,13 @@ int Setup(ArgStruct *p) if(setsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, &(p->prot.sndbufsz), sizeof(p->prot.sndbufsz)) < 0) { - printf("NetPIPE: setsockopt: SO_SNDBUF failed! errno=\n", errno); + printf("NetPIPE: setsockopt: SO_SNDBUF failed! errno=%d\n", errno); exit(556); } if(setsockopt(sockfd, SOL_SOCKET, SO_RCVBUF, &(p->prot.rcvbufsz), sizeof(p->prot.rcvbufsz)) < 0) { - printf("NetPIPE: setsockopt: SO_RCVBUF failed! errno=\n", errno); + printf("NetPIPE: setsockopt: SO_RCVBUF failed! errno=%d\n", errno); exit(556); } } @@ -337,13 +336,13 @@ int Establish(ArgStruct *p) if(setsockopt(p->commfd, SOL_SOCKET, SO_SNDBUF, &(p->prot.sndbufsz), sizeof(p->prot.sndbufsz)) < 0) { - printf("setsockopt: SO_SNDBUF failed! errno=\n", errno); + printf("setsockopt: SO_SNDBUF failed! errno=%d\n", errno); exit(556); } if(setsockopt(p->commfd, SOL_SOCKET, SO_RCVBUF, &(p->prot.rcvbufsz), sizeof(p->prot.rcvbufsz)) < 0) { - printf("setsockopt: SO_RCVBUF failed! errno=\n", errno); + printf("setsockopt: SO_RCVBUF failed! errno=%d\n", errno); exit(556); } } -- Andreas Jaeger SuSE Labs aj...@su... private aj...@ar... http://www.suse.de/~aj ------------------------------------------------------- This SF.net email is sponsored by:Crypto Challenge is now open! Get cracking and register here for some mind boggling fun and the chance of winning an Apple iPod: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en _______________________________________________ Ltp-list mailing list Ltp...@li... https://lists.sourceforge.net/lists/listinfo/ltp-list |