summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart De Schuymer <bdschuym@pandora.be>2011-05-29 13:46:38 +0000
committerBart De Schuymer <bdschuym@pandora.be>2011-05-29 13:46:38 +0000
commit3dd5628ad960353990ca2cca92b86570714bcb7c (patch)
tree7c3f8c4f258fb60f0db56b9591d2b87867e6d0ea
parent7599884a88e4e6ea2cbfe440e5aa59de750e8e7b (diff)
only test on errno when an error occurred (especially on mips); fix some warnings
-rw-r--r--userspace/ebtables2/examples/ulog/test_ulog.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/userspace/ebtables2/examples/ulog/test_ulog.c b/userspace/ebtables2/examples/ulog/test_ulog.c
index f9d2f6c..fbbd909 100644
--- a/userspace/ebtables2/examples/ulog/test_ulog.c
+++ b/userspace/ebtables2/examples/ulog/test_ulog.c
@@ -96,15 +96,15 @@ recv_new:
pkts_per_msg = 0;
len = recvfrom(sfd, buf, BUFLEN, 0,
(struct sockaddr *)&sa_kernel, &addrlen);
- if (errno == EINTR)
- goto recv_new;
if (addrlen != sizeof(sa_kernel)) {
- printf("addrlen %d != %d\n", addrlen,
- sizeof(sa_kernel));
+ printf("addrlen %u != %u\n", addrlen,
+ (uint32_t)sizeof(sa_kernel));
exit(-1);
}
if (len == -1) {
perror("recvmsg");
+ if (errno == EINTR)
+ goto recv_new;
exit(-1);
}
nlh = (struct nlmsghdr *)buf;
@@ -281,7 +281,7 @@ truncated_icmp:
printf("ICMP_ECHO SEQ NR=%u\n", ntohs(icmph->un.echo.sequence));
letscontinue:
- printf("===>Total Packet length: %d, of which we examined "
+ printf("===>Total Packet length: %ld, of which we examined "
"%d bytes\n", msg->data_len, curr_len);
printf("###############################\n"
"######END#OF##PACKET#DUMP######\n"