summaryrefslogtreecommitdiff
path: root/src/ip.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ip.cpp')
-rw-r--r--src/ip.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ip.cpp b/src/ip.cpp
index 5de2485..c24d92f 100644
--- a/src/ip.cpp
+++ b/src/ip.cpp
@@ -301,7 +301,16 @@ int zmq::resolve_ip_hostname (sockaddr_storage *addr_, socklen_t *addr_len_,
addrinfo *res;
int rc = getaddrinfo (hostname.c_str (), service.c_str (), &req, &res);
if (rc) {
+
+ switch (rc) {
+ case EAI_MEMORY:
+ errno = ENOMEM;
+ break;
+ default:
errno = EINVAL;
+ break;
+ }
+
return -1;
}