summaryrefslogtreecommitdiff
path: root/src/platform/posix/posix_udp.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-02-14 14:50:04 -0800
committerGarrett D'Amore <garrett@damore.org>2018-02-14 18:28:36 -0800
commit45bc175ef9278c175d2fc3a0678b49b18e74c449 (patch)
treeb1838778ee898112f28b35178364068c6f48c9b4 /src/platform/posix/posix_udp.c
parent8f93750ed2a6aaa1749eb689ddf119280f9aac7a (diff)
downloadnng-45bc175ef9278c175d2fc3a0678b49b18e74c449.tar.gz
nng-45bc175ef9278c175d2fc3a0678b49b18e74c449.tar.bz2
nng-45bc175ef9278c175d2fc3a0678b49b18e74c449.zip
fixes #234 Investigate enabling more verbose compiler warnings
We enabled verbose compiler warnings, and found a lot of issues. Some of these were even real bugs. As a bonus, we actually save some initialization steps in the compat layer, and avoid passing some variables we don't need.
Diffstat (limited to 'src/platform/posix/posix_udp.c')
-rw-r--r--src/platform/posix/posix_udp.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/platform/posix/posix_udp.c b/src/platform/posix/posix_udp.c
index cd7b0561..cde58e7c 100644
--- a/src/platform/posix/posix_udp.c
+++ b/src/platform/posix/posix_udp.c
@@ -108,7 +108,6 @@ nni_posix_udp_dosend(nni_plat_udp *udp)
{
nni_aio * aio;
nni_list *q = &udp->udp_sendq;
- int x = 0;
// While we're able to send, do so.
while ((aio = nni_list_first(q)) != NULL) {
@@ -119,7 +118,7 @@ nni_posix_udp_dosend(nni_plat_udp *udp)
int cnt = 0;
len = nni_posix_nn2sockaddr(&ss, nni_aio_get_input(aio, 0));
- if (len < 0) {
+ if (len < 1) {
rv = NNG_EADDRINVAL;
} else {
struct msghdr hdr;
@@ -211,7 +210,7 @@ nni_plat_udp_open(nni_plat_udp **upp, nni_sockaddr *bindaddr)
struct sockaddr_storage sa;
int rv;
- if ((salen = nni_posix_nn2sockaddr(&sa, bindaddr)) < 0) {
+ if ((salen = nni_posix_nn2sockaddr(&sa, bindaddr)) < 1) {
return (NNG_EADDRINVAL);
}
@@ -261,8 +260,6 @@ nni_plat_udp_open(nni_plat_udp **upp, nni_sockaddr *bindaddr)
void
nni_plat_udp_close(nni_plat_udp *udp)
{
- nni_aio *aio;
-
// We're no longer interested in events.
nni_posix_pollq_remove(&udp->udp_pitem);