From: Brian Aker Date: Sat, 30 Jun 2012 03:12:06 +0000 (-0700) Subject: Set SASL errors correctly. X-Git-Tag: 1.0.9~9 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=edbdb9c55b66d2cc1befe6e589c2bfc98ea2d7fb;p=m6w6%2Flibmemcached Set SASL errors correctly. --- diff --git a/libmemcached/sasl.cc b/libmemcached/sasl.cc index 3d93b786..cb609257 100644 --- a/libmemcached/sasl.cc +++ b/libmemcached/sasl.cc @@ -74,12 +74,12 @@ static memcached_return_t resolve_names(memcached_instance_st& server, char *lad if (getsockname(server.fd, (struct sockaddr *)&saddr, &salen) < 0) { - return memcached_set_errno(server, MEMCACHED_ERRNO, MEMCACHED_AT); + return memcached_set_error(server, MEMCACHED_HOST_LOOKUP_FAILURE, MEMCACHED_AT); } if (getnameinfo((struct sockaddr *)&saddr, salen, host, sizeof(host), port, sizeof(port), NI_NUMERICHOST | NI_NUMERICSERV) < 0) { - return MEMCACHED_HOST_LOOKUP_FAILURE; + return memcached_set_error(server, MEMCACHED_HOST_LOOKUP_FAILURE, MEMCACHED_AT); } (void)snprintf(laddr, laddr_length, "%s;%s", host, port); @@ -87,7 +87,7 @@ static memcached_return_t resolve_names(memcached_instance_st& server, char *lad if (getpeername(server.fd, (struct sockaddr *)&saddr, &salen) < 0) { - return memcached_set_errno(server, MEMCACHED_ERRNO, MEMCACHED_AT); + return memcached_set_error(server, MEMCACHED_HOST_LOOKUP_FAILURE, MEMCACHED_AT); } if (getnameinfo((struct sockaddr *)&saddr, salen, host, sizeof(host),