From edbdb9c55b66d2cc1befe6e589c2bfc98ea2d7fb Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Fri, 29 Jun 2012 20:12:06 -0700 Subject: [PATCH] Set SASL errors correctly. --- libmemcached/sasl.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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), -- 2.30.2