From: Andreas J. <aj...@su...> - 2003-03-14 10:15:48
|
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 |