summaryrefslogtreecommitdiff
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
commit410ebf9d318de6e0debaf932252b7aa6099639ae (patch)
treeb311350c574d3580c91098a5e872d3d9295a51ee
parent6f7130a8707adc260c07cf1cb3e884bf857d0b9e (diff)
downloadebtables-410ebf9d318de6e0debaf932252b7aa6099639ae.tar.gz
ebtables-410ebf9d318de6e0debaf932252b7aa6099639ae.tar.bz2
ebtables-410ebf9d318de6e0debaf932252b7aa6099639ae.zip
only test on errno when an error occurred (especially on mips); fix some warnings
-rw-r--r--examples/ulog/test_ulog.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/ulog/test_ulog.c b/examples/ulog/test_ulog.c
index f9d2f6c..fbbd909 100644
--- a/examples/ulog/test_ulog.c
+++ b/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"