From f667689bb99d04d6fa25e29f358f15dac32acd59 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 19 Oct 2020 16:49:51 +0200 Subject: [PATCH] memcached_return_t: revert ABI break and reuse old error code --- CMakeVersions.txt | 2 +- include/libmemcached-1.0/types/return.h | 3 +-- src/libmemcached/connect.cc | 2 +- src/libmemcached/strerror.cc | 5 +---- 4 files changed, 4 insertions(+), 8 deletions(-) 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"; -- 2.30.2