diff --git a/libmariadb/mariadb_async.c b/libmariadb/mariadb_async.c index feb73329..5068f5c0 100644 --- a/libmariadb/mariadb_async.c +++ b/libmariadb/mariadb_async.c @@ -140,7 +140,7 @@ my_ssl_async_check_result(int res, struct mysql_async_context *b, MARIADB_SSL *c { int ssl_err; b->events_to_wait_for= 0; - if (res >= 0) + if (res > 0) return 1; ssl_err= SSL_get_error(ssl, res); if (ssl_err == SSL_ERROR_WANT_READ) diff --git a/libmariadb/secure/openssl.c b/libmariadb/secure/openssl.c index 2a272504..edc90a3b 100644 --- a/libmariadb/secure/openssl.c +++ b/libmariadb/secure/openssl.c @@ -533,7 +533,7 @@ ma_tls_async_check_result(int res, struct mysql_async_context *b, SSL *ssl) { int ssl_err; b->events_to_wait_for= 0; - if (res >= 0) + if (res > 0) return 1; ssl_err= SSL_get_error(ssl, res); if (ssl_err == SSL_ERROR_WANT_READ) diff --git a/plugins/io/remote_io.c b/plugins/io/remote_io.c index c06ecacd..eb5b5f37 100644 --- a/plugins/io/remote_io.c +++ b/plugins/io/remote_io.c @@ -279,11 +279,11 @@ MA_FILE *ma_rio_open(const char *url,const char *operation) MA_REMOTE_FILE *rf; (void)operation; - if (!(file = (MA_FILE *)calloc(sizeof(MA_FILE), 1))) + if (!(file = (MA_FILE *)calloc(1, sizeof(MA_FILE)))) return NULL; file->type= MA_FILE_REMOTE; - if (!(file->ptr= rf= (MA_REMOTE_FILE *)calloc(sizeof(MA_REMOTE_FILE), 1))) + if (!(file->ptr= rf= (MA_REMOTE_FILE *)calloc(1, sizeof(MA_REMOTE_FILE)))) { free(file); return NULL; diff --git a/plugins/pvio/pvio_socket.c b/plugins/pvio/pvio_socket.c index 550fb831..b9c70940 100644 --- a/plugins/pvio/pvio_socket.c +++ b/plugins/pvio/pvio_socket.c @@ -39,7 +39,7 @@ #include #endif #ifdef HAVE_POLL -#include +#include #endif #ifdef HAVE_SYS_IOCTL_H #include diff --git a/plugins/trace/trace_example.c b/plugins/trace/trace_example.c index 1060542c..e177c206 100644 --- a/plugins/trace/trace_example.c +++ b/plugins/trace/trace_example.c @@ -132,7 +132,7 @@ static TRACE_INFO *get_trace_info(unsigned long thread_id) info= (TRACE_INFO *)info->next; } - if (!(info= (TRACE_INFO *)calloc(sizeof(TRACE_INFO), 1))) + if (!(info= (TRACE_INFO *)calloc(1, sizeof(TRACE_INFO)))) return NULL; info->thread_id= thread_id; info->next= trace_info;