From: Jon M. <jon...@er...> - 2019-03-20 11:47:28
|
This looks ok to me. If you are interested I can add you as developer in the project, and you can check in the changes to SF yourself. BR ///jon > -----Original Message----- > From: Peter Fröhlich <pet...@gm...> > Sent: 20-Mar-19 12:31 > To: tip...@li... > Subject: [tipc-discussion] Random quick fixes > > Hi all, > > Sorry, I am not sure what the "official" process is but I had to make a few > changes to the current tipcutils to get things to compile without warnings. > The diffs are below. Note that I didn't really "test" any of this, I am just > starting out with tipc but I like to start from a "clean slate" when I look into a > new codebase. Feel free to ignore if it's useless. > > Best, > Peter > > --- > diff --git a/test/group_test/worker.c b/test/group_test/worker.c index > 95a5234..2e1f7c6 100644 > --- a/test/group_test/worker.c > +++ b/test/group_test/worker.c > @@ -168,7 +168,7 @@ static void print_stats(struct context *ctx) > unsigned long long msg_per_sec; > unsigned long long thruput; > unsigned long long snt, rcvd; > - char str[64]; > + char str[128]; > > if (!ctx->stats && (vlevel < 2)) > return; > @@ -349,7 +349,7 @@ static void rcv_traffic_msgs(struct context *ctx) > ctx->error = BAD_SRC_ADDR; > else if (hdr->check_length && rc != ctx->msg_len) > ctx->error = BAD_LENGTH; > - > + > if (mtyp == UNICAST) > ctx->rcv_uc++; > else if (mtyp == ANYCAST) diff --git a/test/iovec/iovec_client.c > b/test/iovec/iovec_client.c index 4eabb2d..ca5600a 100644 > --- a/test/iovec/iovec_client.c > +++ b/test/iovec/iovec_client.c > @@ -2,6 +2,7 @@ > * > */ > > +#include <sys/uio.h> > #include <sys/types.h> > #include <sys/socket.h> > #include <stdlib.h> > @@ -93,7 +94,7 @@ static struct msghdr *create_msg(int msgsize, int > numiov) { > > struct msghdr *m; > struct iovec *iov; > - int p, i, iovlen, total = 0; > + int i, iovlen, total = 0; > uint16_t cksum; > char *data; > char *iovp; > diff --git a/test/iovec/iovec_server.c b/test/iovec/iovec_server.c index > ee3fd1d..d19bc4f 100644 > --- a/test/iovec/iovec_server.c > +++ b/test/iovec/iovec_server.c > @@ -243,9 +243,10 @@ void sigcatcher(int sig) > case SIGKILL: > case SIGHUP: > for (i=0; i < 3; i++) { > - if (server[i] > 0) > + if (server[i] > 0) { > printf("Killing test server %d\n", i); > kill(server[i], SIGTERM); > + } > } > printf("Iovec server killed\n"); > fflush(stdout); > diff --git a/test/ptts/tipc_ts_common.c b/test/ptts/tipc_ts_common.c index > d7da0b7..8d73a7a 100644 > --- a/test/ptts/tipc_ts_common.c > +++ b/test/ptts/tipc_ts_common.c > @@ -403,7 +403,7 @@ void setOption > int value /* value to set */ > ) > { > - char failString[50]; /* string for failure return code */ > + char failString[128]; /* string for failure return code */ > > if (setsockopt (sockfd, SOL_TIPC, opt, > (char*)&value, sizeof (value))) { @@ -423,7 +423,7 @@ void > getOption > int *value /* returned value */ > ) > { > - char failString[50]; /* string for failure return code */ > + char failString[128]; /* string for failure return code */ > socklen_t size; /* size of the socket option value */ > > size = sizeof(*value); > @@ -934,7 +934,7 @@ void common_test_socketOptions(void) > int sol; /* socket to listen on */ > struct sockaddr_tipc saddr; /* address structure for socket */ > char buf[2048]; /* buffer for message */ > - char failString[100]; /* string for the > failure return code */ > + char failString[128]; /* string for the > failure return code */ > > int ii; /* loop index for the sockets */ > int jj; /* loop index for the > option value */ > @@ -1112,7 +1112,7 @@ void common_test_recvfrom { > > char buffer [MAX_STR]; /* buffer for message to be received in */ > - char failStr [50 + MAX_STR]; /* string for failure return code */ > + char failStr [128 + MAX_STR]; /* string for failure return code */ > struct sockaddr_tipc addr; /* address of socket */ > int so; /* socket to use */ > int size; /* size of the received message */ > diff --git a/utils/tipc-link-watcher/tipc-link-watcher.c > b/utils/tipc-link-watcher/tipc-link-watcher.c > index a24cf19..075d2eb 100644 > --- a/utils/tipc-link-watcher/tipc-link-watcher.c > +++ b/utils/tipc-link-watcher/tipc-link-watcher.c > @@ -1552,7 +1552,7 @@ static bool handle_getsubopt(char **optionp, char > *const *tokens, > int sub_opt; > int tmp; > char *valuep; > - while (*optionp != '\0') { > + while (**optionp != '\0') { > sub_opt = getsubopt (optionp, tokens, &valuep); > if ((t_low < sub_opt) && (sub_opt < t_high) ) > { > > > _______________________________________________ > tipc-discussion mailing list > tip...@li... > https://lists.sourceforge.net/lists/listinfo/tipc-discussion |