diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-02-14 14:50:04 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-02-14 18:28:36 -0800 |
| commit | 45bc175ef9278c175d2fc3a0678b49b18e74c449 (patch) | |
| tree | b1838778ee898112f28b35178364068c6f48c9b4 /src/platform/posix/posix_sockaddr.c | |
| parent | 8f93750ed2a6aaa1749eb689ddf119280f9aac7a (diff) | |
| download | nng-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_sockaddr.c')
| -rw-r--r-- | src/platform/posix/posix_sockaddr.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/platform/posix/posix_sockaddr.c b/src/platform/posix/posix_sockaddr.c index 25953f50..e9691d91 100644 --- a/src/platform/posix/posix_sockaddr.c +++ b/src/platform/posix/posix_sockaddr.c @@ -1,6 +1,6 @@ // -// Copyright 2017 Garrett D'Amore <garrett@damore.org> -// Copyright 2017 Capitar IT Group BV <info@capitar.com> +// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2018 Capitar IT Group BV <info@capitar.com> // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -22,7 +22,7 @@ #include <sys/types.h> #include <sys/un.h> -int +size_t nni_posix_nn2sockaddr(void *sa, const nni_sockaddr *na) { struct sockaddr_in * sin; @@ -34,7 +34,7 @@ nni_posix_nn2sockaddr(void *sa, const nni_sockaddr *na) size_t sz; if ((sa == NULL) || (na == NULL)) { - return (-1); + return (0); } switch (na->s_un.s_family) { case NNG_AF_INET: @@ -65,12 +65,12 @@ nni_posix_nn2sockaddr(void *sa, const nni_sockaddr *na) // Make sure that the path fits! sz = sizeof(spath->sun_path); if (nni_strlcpy(spath->sun_path, nspath->sa_path, sz) >= sz) { - return (-1); + return (0); } spath->sun_family = PF_UNIX; return (sizeof(*spath)); } - return (-1); + return (0); } int |
