diff options
Diffstat (limited to 'wsrep')
-rw-r--r-- | wsrep/CMakeLists.txt | 2 | ||||
-rw-r--r-- | wsrep/wsrep_api.h | 1 | ||||
-rw-r--r-- | wsrep/wsrep_dummy.c | 23 | ||||
-rw-r--r-- | wsrep/wsrep_loader.c | 13 |
4 files changed, 18 insertions, 21 deletions
diff --git a/wsrep/CMakeLists.txt b/wsrep/CMakeLists.txt index 182e4586ddc..53c8e853078 100644 --- a/wsrep/CMakeLists.txt +++ b/wsrep/CMakeLists.txt @@ -13,8 +13,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -INCLUDE_DIRECTORIES( "." ) - SET(WSREP_SOURCES wsrep_gtid.c wsrep_uuid.c wsrep_loader.c wsrep_dummy.c) ADD_CONVENIENCE_LIBRARY(wsrep ${WSREP_SOURCES}) diff --git a/wsrep/wsrep_api.h b/wsrep/wsrep_api.h index c3304d7ed7c..e713be094df 100644 --- a/wsrep/wsrep_api.h +++ b/wsrep/wsrep_api.h @@ -48,7 +48,6 @@ #define WSREP_H #include <stdint.h> -#include <stdbool.h> #include <stdlib.h> #include <unistd.h> #include <time.h> diff --git a/wsrep/wsrep_dummy.c b/wsrep/wsrep_dummy.c index 1780e91f89d..eae084f1979 100644 --- a/wsrep/wsrep_dummy.c +++ b/wsrep/wsrep_dummy.c @@ -19,7 +19,6 @@ #include "wsrep_api.h" #include <errno.h> -#include <stdbool.h> #include <string.h> /*! Dummy backend context. */ @@ -171,7 +170,7 @@ static wsrep_status_t dummy_append_key( const wsrep_key_t* key __attribute__((unused)), const size_t key_num __attribute__((unused)), const wsrep_key_type_t key_type __attribute__((unused)), - const bool copy __attribute__((unused))) + const wsrep_bool_t copy __attribute__((unused))) { WSREP_DBUG_ENTER(w); return WSREP_OK; @@ -183,7 +182,7 @@ static wsrep_status_t dummy_append_data( const struct wsrep_buf* data __attribute__((unused)), const size_t count __attribute__((unused)), const wsrep_data_type_t type __attribute__((unused)), - const bool copy __attribute__((unused))) + const wsrep_bool_t copy __attribute__((unused))) { WSREP_DBUG_ENTER(w); return WSREP_OK; @@ -326,10 +325,10 @@ static wsrep_status_t dummy_resync (wsrep_t* w) } static wsrep_status_t dummy_lock (wsrep_t* w, - const char* s __attribute__((unused)), - bool r __attribute__((unused)), - uint64_t o __attribute__((unused)), - int64_t t __attribute__((unused))) + const char* s __attribute__((unused)), + wsrep_bool_t r __attribute__((unused)), + uint64_t o __attribute__((unused)), + int64_t t __attribute__((unused))) { WSREP_DBUG_ENTER(w); return WSREP_NOT_IMPLEMENTED; @@ -343,13 +342,13 @@ static wsrep_status_t dummy_unlock (wsrep_t* w, return WSREP_OK; } -static bool dummy_is_locked (wsrep_t* w, - const char* s __attribute__((unused)), - uint64_t* o __attribute__((unused)), - wsrep_uuid_t* t __attribute__((unused))) +static wsrep_bool_t dummy_is_locked (wsrep_t* w, + const char* s __attribute__((unused)), + uint64_t* o __attribute__((unused)), + wsrep_uuid_t* t __attribute__((unused))) { WSREP_DBUG_ENTER(w); - return false; + return 0; } static wsrep_t dummy_iface = { diff --git a/wsrep/wsrep_loader.c b/wsrep/wsrep_loader.c index 5f98b0ace6a..f4d5991339e 100644 --- a/wsrep/wsrep_loader.c +++ b/wsrep/wsrep_loader.c @@ -134,7 +134,8 @@ int wsrep_load(const char *spec, wsrep_t **hptr, wsrep_log_cb_t log_cb) int ret = 0; void *dlh = NULL; wsrep_loader_fun dlfun; - char msg[1024]; + char msg[1025]; + msg[sizeof(msg)-1] = 0; if (NULL != log_cb) logger = log_cb; @@ -142,7 +143,7 @@ int wsrep_load(const char *spec, wsrep_t **hptr, wsrep_log_cb_t log_cb) if (!(spec && hptr)) return EINVAL; - snprintf (msg, sizeof(msg), + snprintf (msg, sizeof(msg)-1, "wsrep_load(): loading provider library '%s'", spec); logger (WSREP_LOG_INFO, msg); @@ -160,7 +161,7 @@ int wsrep_load(const char *spec, wsrep_t **hptr, wsrep_log_cb_t log_cb) } if (!(dlh = dlopen(spec, RTLD_NOW | RTLD_LOCAL))) { - snprintf(msg, sizeof(msg), "wsrep_load(): dlopen(): %s", dlerror()); + snprintf(msg, sizeof(msg)-1, "wsrep_load(): dlopen(): %s", dlerror()); logger (WSREP_LOG_ERROR, msg); ret = EINVAL; goto out; @@ -177,14 +178,14 @@ int wsrep_load(const char *spec, wsrep_t **hptr, wsrep_log_cb_t log_cb) } if ((ret = (*dlfun)(*hptr)) != 0) { - snprintf(msg, sizeof(msg), "wsrep_load(): loader failed: %s", + snprintf(msg, sizeof(msg)-1, "wsrep_load(): loader failed: %s", strerror(ret)); logger (WSREP_LOG_ERROR, msg); goto out; } if ((ret = verify(*hptr, WSREP_INTERFACE_VERSION)) != 0) { - snprintf (msg, sizeof(msg), + snprintf (msg, sizeof(msg)-1, "wsrep_load(): interface version mismatch: my version %s, " "provider version %s", WSREP_INTERFACE_VERSION, (*hptr)->version); @@ -200,7 +201,7 @@ out: free(*hptr); *hptr = NULL; } else { - snprintf (msg, sizeof(msg), + snprintf (msg, sizeof(msg)-1, "wsrep_load(): %s %s by %s loaded successfully.", (*hptr)->provider_name, (*hptr)->provider_version, (*hptr)->provider_vendor); |