summaryrefslogtreecommitdiff
path: root/src/platform/posix
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-12-28 16:02:53 -0800
committerGarrett D'Amore <garrett@damore.org>2017-12-28 16:02:53 -0800
commitaa3bb50aeca3b7350a41f0538817c49d9656d207 (patch)
tree4abafbdc7553e52776394e067fa1ff9a08a14a57 /src/platform/posix
parent838d92deabffbaae1b1a9e447d2088f966078726 (diff)
downloadnng-aa3bb50aeca3b7350a41f0538817c49d9656d207.tar.gz
nng-aa3bb50aeca3b7350a41f0538817c49d9656d207.tar.bz2
nng-aa3bb50aeca3b7350a41f0538817c49d9656d207.zip
Fix compilation warnings, bugs, and crashes found on Windows.
This addresses a number of problems that were found on Windows, including one bug that actually turned up in testing on POSIX.
Diffstat (limited to 'src/platform/posix')
-rw-r--r--src/platform/posix/posix_epdesc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/platform/posix/posix_epdesc.c b/src/platform/posix/posix_epdesc.c
index 80711ed0..7b168679 100644
--- a/src/platform/posix/posix_epdesc.c
+++ b/src/platform/posix/posix_epdesc.c
@@ -318,6 +318,7 @@ nni_posix_epdesc_accept(nni_posix_epdesc *ed, nni_aio *aio)
// connection is ready for us. There isn't anything else for us to
// do really, as that will have been done in listen.
nni_mtx_lock(&ed->mtx);
+ aio->a_pipe = NULL;
// If we can't start, it means that the AIO was stopped.
if ((rv = nni_aio_start(aio, nni_posix_epdesc_cancel, ed)) != 0) {
nni_mtx_unlock(&ed->mtx);
@@ -343,6 +344,7 @@ nni_posix_epdesc_connect(nni_posix_epdesc *ed, nni_aio *aio)
int fd;
nni_mtx_lock(&ed->mtx);
+ aio->a_pipe = NULL;
// If we can't start, it means that the AIO was stopped.
if ((rv = nni_aio_start(aio, nni_posix_epdesc_cancel, ed)) != 0) {
nni_mtx_unlock(&ed->mtx);