From 5274cc277f4a1216a7d566d2bb164c80e0d44d43 Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Sun, 16 Sep 2012 04:59:27 -0400 Subject: [PATCH] Fix errno return to line up with error on socket. --- libmemcached/error.cc | 5 +++++ tests/libmemcached-1.0/include.am | 3 +++ 2 files changed, 8 insertions(+) diff --git a/libmemcached/error.cc b/libmemcached/error.cc index 38c568c9..99316f1d 100644 --- a/libmemcached/error.cc +++ b/libmemcached/error.cc @@ -106,6 +106,11 @@ static void _set(memcached_st& memc, memcached_string_t *str, memcached_return_t rc= MEMCACHED_CONNECTION_FAILURE; } + if (rc == MEMCACHED_ERRNO and local_errno == ECONNRESET) + { + rc= MEMCACHED_CONNECTION_FAILURE; + } + if (local_errno == EINVAL) { rc= MEMCACHED_INVALID_ARGUMENTS; diff --git a/tests/libmemcached-1.0/include.am b/tests/libmemcached-1.0/include.am index 06cd8747..e5f00b9b 100644 --- a/tests/libmemcached-1.0/include.am +++ b/tests/libmemcached-1.0/include.am @@ -168,6 +168,9 @@ tests_libmemcached_1_0_testsocket_LDADD+= libhashkit/libhashkit.la check_PROGRAMS+= tests/libmemcached-1.0/testsocket noinst_PROGRAMS+= tests/libmemcached-1.0/testsocket +test-socket: tests/libmemcached-1.0/testsocket + @tests/libmemcached-1.0/testsocket + tests_libmemcached_1_0_sasl_SOURCES= tests_libmemcached_1_0_sasl_DEPENDENCIES= tests_libmemcached_1_0_sasl_LDADD= -- 2.30.2