From 856c5c8e2aa4e07b2b628dd194a63ae13dae7ae3 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Tue, 3 Jan 2017 23:50:12 -0800 Subject: Working towards TCP support. --- src/nng.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/nng.c') diff --git a/src/nng.c b/src/nng.c index 79069723..b0f39222 100644 --- a/src/nng.c +++ b/src/nng.c @@ -180,9 +180,24 @@ nng_strerror(int num) case NNG_ENOENT: return ("Entry not found"); - default: - return ("Unknown error"); + case NNG_EPROTO: + return ("Protocol error"); + + case NNG_EUNREACHABLE: + return ("Destination unreachable"); + + case NNG_EADDRINVAL: + return ("Address invalid"); + + case NNG_EPERM: + return ("Permission denied"); } + + if (num & NNG_ESYSERR) { + return (nni_plat_strerror(num & ~NNG_ESYSERR)); + } + + return ("Unknown error"); } -- cgit v1.2.3-70-g09d2