From: Michael Wallner Date: Mon, 19 Oct 2020 14:49:51 +0000 (+0200) Subject: memcached_return_t: revert ABI break and reuse old error code X-Git-Tag: 1.1.0-beta1~197 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=f667689bb99d04d6fa25e29f358f15dac32acd59;p=m6w6%2Flibmemcached memcached_return_t: revert ABI break and reuse old error code --- diff --git a/CMakeVersions.txt b/CMakeVersions.txt index 4917c947..8243ec38 100644 --- a/CMakeVersions.txt +++ b/CMakeVersions.txt @@ -28,7 +28,7 @@ to_hex(LIBMEMCACHED_VERSION_HEX ${LIBMEMCACHED_VERSION_MAJOR} ${LIBMEMCACHED_VER # libmemcached.so -set(LIBMEMCACHED_SO_VERSION_CUR 12) +set(LIBMEMCACHED_SO_VERSION_CUR 11) set(LIBMEMCACHED_SO_VERSION_REV 0) set(LIBMEMCACHED_SO_VERSION_AGE 0) diff --git a/include/libmemcached-1.0/types/return.h b/include/libmemcached-1.0/types/return.h index 80c90515..93e9e975 100644 --- a/include/libmemcached-1.0/types/return.h +++ b/include/libmemcached-1.0/types/return.h @@ -1,5 +1,5 @@ /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * + * * Libmemcached library * * Copyright (C) 2011 Data Differential, http://datadifferential.com/ @@ -86,7 +86,6 @@ enum memcached_return_t { MEMCACHED_IN_PROGRESS, MEMCACHED_SERVER_TEMPORARILY_DISABLED, MEMCACHED_SERVER_MEMORY_ALLOCATION_FAILURE, - MEMCACHED_UNIX_SOCKET_PATH_TOO_BIG, MEMCACHED_MAXIMUM_RETURN, /* Always add new error code before */ MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE= MEMCACHED_ERROR }; diff --git a/src/libmemcached/connect.cc b/src/libmemcached/connect.cc index 37972bc9..7579de5c 100644 --- a/src/libmemcached/connect.cc +++ b/src/libmemcached/connect.cc @@ -467,7 +467,7 @@ static memcached_return_t unix_socket_connect(memcached_instance_st* server) memset(&servAddr, 0, sizeof (struct sockaddr_un)); servAddr.sun_family= AF_UNIX; if (strlen(server->hostname()) >= sizeof(servAddr.sun_path)) { - return memcached_set_error(*server, MEMCACHED_UNIX_SOCKET_PATH_TOO_BIG, MEMCACHED_AT); + return memcached_set_error(*server, MEMCACHED_FAIL_UNIX_SOCKET, MEMCACHED_AT); } strncpy(servAddr.sun_path, server->hostname(), sizeof(servAddr.sun_path)-1); /* Copy filename */ diff --git a/src/libmemcached/strerror.cc b/src/libmemcached/strerror.cc index 7b3a9df3..0c0c9a1b 100644 --- a/src/libmemcached/strerror.cc +++ b/src/libmemcached/strerror.cc @@ -1,5 +1,5 @@ /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * + * * Libmemcached library * * Copyright (C) 2011 Data Differential, http://datadifferential.com/ @@ -188,9 +188,6 @@ const char *memcached_strerror(const memcached_st *, memcached_return_t rc) case MEMCACHED_SERVER_MEMORY_ALLOCATION_FAILURE: return "SERVER FAILED TO ALLOCATE OBJECT"; - case MEMCACHED_UNIX_SOCKET_PATH_TOO_BIG: - return "UNIX SOCKET PATH TOO LARGE"; - default: case MEMCACHED_MAXIMUM_RETURN: return "INVALID memcached_return_t";