aboutsummaryrefslogtreecommitdiff
path: root/src/platform/posix/posix_debug.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-01-14 13:00:55 -0800
committerGarrett D'Amore <garrett@damore.org>2017-01-14 13:00:55 -0800
commitf4ce5a285167e7656037096f77f04ab80a010453 (patch)
tree48a9746e154872e4a01c9dee465aed716af278be /src/platform/posix/posix_debug.c
parentb639e4d3643b8245b77bc8707a3a864221fad195 (diff)
downloadnng-f4ce5a285167e7656037096f77f04ab80a010453.tar.gz
nng-f4ce5a285167e7656037096f77f04ab80a010453.tar.bz2
nng-f4ce5a285167e7656037096f77f04ab80a010453.zip
Windows TCP now working.
There are lots of changes here, mostly stuff we did in support of Windows TCP. However, there are some bugs that were fixed, and we added some new error codes, and generalized the handling of some failures during accept. Windows IPC (NamedPipes) is still missing.
Diffstat (limited to 'src/platform/posix/posix_debug.c')
-rw-r--r--src/platform/posix/posix_debug.c61
1 files changed, 30 insertions, 31 deletions
diff --git a/src/platform/posix/posix_debug.c b/src/platform/posix/posix_debug.c
index 71006b25..6199df1d 100644
--- a/src/platform/posix/posix_debug.c
+++ b/src/platform/posix/posix_debug.c
@@ -40,8 +40,6 @@ nni_plat_strerror(int errnum)
}
-#define NNI_ERR(x, y) { x, y },
-
// There are of course other errors than these, but these are the ones
// that we might reasonably expect and want to handle "cleanly". Most of
// the others should be handled by the system error code. Note that EFAULT
@@ -55,35 +53,36 @@ static struct {
int nng_err;
}
nni_plat_errnos[] = {
- NNI_ERR(EINTR, NNG_EINTR)
- NNI_ERR(EINVAL, NNG_EINVAL)
- NNI_ERR(ENOMEM, NNG_ENOMEM)
- NNI_ERR(EACCES, NNG_EPERM)
- NNI_ERR(EADDRINUSE, NNG_EADDRINUSE)
- NNI_ERR(EADDRNOTAVAIL, NNG_EADDRINVAL)
- NNI_ERR(EAFNOSUPPORT, NNG_ENOTSUP)
- NNI_ERR(EAGAIN, NNG_EAGAIN)
- NNI_ERR(EBADF, NNG_ECLOSED)
- NNI_ERR(EBUSY, NNG_EBUSY)
- NNI_ERR(ECONNABORTED, NNG_ECLOSED)
- NNI_ERR(ECONNREFUSED, NNG_ECONNREFUSED)
- NNI_ERR(ECONNRESET, NNG_ECLOSED)
- NNI_ERR(EHOSTUNREACH, NNG_EUNREACHABLE)
- NNI_ERR(ENETUNREACH, NNG_EUNREACHABLE)
- NNI_ERR(ENAMETOOLONG, NNG_EINVAL)
- NNI_ERR(ENOENT, NNG_ENOENT)
- NNI_ERR(ENOBUFS, NNG_ENOMEM)
- NNI_ERR(ENOPROTOOPT, NNG_ENOTSUP)
- NNI_ERR(ENOSYS, NNG_ENOTSUP)
- NNI_ERR(ENOTSUP, NNG_ENOTSUP)
- NNI_ERR(EPERM, NNG_EPERM)
- NNI_ERR(EPIPE, NNG_ECLOSED)
- NNI_ERR(EPROTO, NNG_EPROTO)
- NNI_ERR(EPROTONOSUPPORT, NNG_ENOTSUP)
- NNI_ERR(ETIME, NNG_ETIMEDOUT)
- NNI_ERR(ETIMEDOUT, NNG_ETIMEDOUT)
- NNI_ERR(EWOULDBLOCK, NNG_EAGAIN)
- NNI_ERR(0, 0) // must be last
+ { EINTR, NNG_EINTR },
+ { EINVAL, NNG_EINVAL },
+ { ENOMEM, NNG_ENOMEM },
+ { EACCES, NNG_EPERM },
+ { EADDRINUSE, NNG_EADDRINUSE },
+ { EADDRNOTAVAIL, NNG_EADDRINVAL },
+ { EAFNOSUPPORT, NNG_ENOTSUP },
+ { EAGAIN, NNG_EAGAIN },
+ { EBADF, NNG_ECLOSED },
+ { EBUSY, NNG_EBUSY },
+ { ECONNABORTED, NNG_ECONNABORTED },
+ { ECONNREFUSED, NNG_ECONNREFUSED },
+ { ECONNRESET, NNG_ECONNRESET },
+ { EHOSTUNREACH, NNG_EUNREACHABLE },
+ { ENETUNREACH, NNG_EUNREACHABLE },
+ { ENAMETOOLONG, NNG_EINVAL },
+ { ENOENT, NNG_ENOENT },
+ { ENOBUFS, NNG_ENOMEM },
+ { ENOPROTOOPT, NNG_ENOTSUP },
+ { ENOSYS, NNG_ENOTSUP },
+ { ENOTSUP, NNG_ENOTSUP },
+ { EPERM, NNG_EPERM },
+ { EPIPE, NNG_ECLOSED },
+ { EPROTO, NNG_EPROTO },
+ { EPROTONOSUPPORT, NNG_ENOTSUP },
+ { ETIME, NNG_ETIMEDOUT },
+ { ETIMEDOUT, NNG_ETIMEDOUT },
+ { EWOULDBLOCK, NNG_EAGAIN },
+ // must be last
+ { 0, 0 },
};
int