diff options
Diffstat (limited to 'src/platform/posix/posix_debug.c')
| -rw-r--r-- | src/platform/posix/posix_debug.c | 61 |
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 |
