Fix errno return to line up with error on socket.
authorBrian Aker <brian@tangent.org>
Sun, 16 Sep 2012 08:59:27 +0000 (04:59 -0400)
committerBrian Aker <brian@tangent.org>
Sun, 16 Sep 2012 08:59:27 +0000 (04:59 -0400)
libmemcached/error.cc
tests/libmemcached-1.0/include.am

index 38c568c91cdf48dd4b51088169646e6bfa44b2ed..99316f1d18f7b0a5e0ef2474eb6d9bd264565f84 100644 (file)
@@ -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;
index 06cd87474cbd0b9da2907a679fa63c85a2209ba7..e5f00b9b147d22298f73f6b7ff8c0312b5b6d709 100644 (file)
@@ -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=