Fixed some compiler warnings, added header includes, return values etc.
This commit is contained in:
VilhoRaatikka
2014-05-27 10:08:17 +03:00
parent d6f0f936ec
commit 70115d35c9
8 changed files with 15 additions and 6 deletions

View File

@ -41,7 +41,7 @@ UTILSPATH := $(ROOT_PATH)/utils
CC=cc CC=cc
CFLAGS=-c -I/usr/include -I../include -I../inih \ CFLAGS=-c -I/usr/include -I../include -I../modules/include -I../inih \
$(MYSQL_HEADERS) \ $(MYSQL_HEADERS) \
-I$(LOGPATH) -I$(UTILSPATH) \ -I$(LOGPATH) -I$(UTILSPATH) \
-Wall -g -Wall -g
@ -59,7 +59,7 @@ SRCS= atomic.c buffer.c spinlock.c gateway.c \
monitor.c adminusers.c secrets.c monitor.c adminusers.c secrets.c
HDRS= ../include/atomic.h ../include/buffer.h ../include/dcb.h \ HDRS= ../include/atomic.h ../include/buffer.h ../include/dcb.h \
../include/gw.h ../include/mysql_protocol.h \ ../include/gw.h ../modules/include/mysql_client_server_protocol.h \
../include/session.h ../include/spinlock.h ../include/thread.h \ ../include/session.h ../include/spinlock.h ../include/thread.h \
../include/modules.h ../include/poll.h ../include/config.h \ ../include/modules.h ../include/poll.h ../include/config.h \
../include/users.h ../include/hashtable.h ../include/gwbitmask.h \ ../include/users.h ../include/hashtable.h ../include/gwbitmask.h \

View File

@ -42,6 +42,7 @@
#include <skygw_utils.h> #include <skygw_utils.h>
#include <log_manager.h> #include <log_manager.h>
#include <secrets.h> #include <secrets.h>
#include <mysql_client_server_protocol.h>
#define USERS_QUERY_NO_ROOT " AND user NOT IN ('root')" #define USERS_QUERY_NO_ROOT " AND user NOT IN ('root')"
#define LOAD_MYSQL_USERS_QUERY "SELECT user, host, password, concat(user,host,password) AS userdata FROM mysql.user WHERE user IS NOT NULL AND user <> ''" #define LOAD_MYSQL_USERS_QUERY "SELECT user, host, password, concat(user,host,password) AS userdata FROM mysql.user WHERE user IS NOT NULL AND user <> ''"

View File

@ -68,6 +68,7 @@
#include <atomic.h> #include <atomic.h>
#include <skygw_utils.h> #include <skygw_utils.h>
#include <log_manager.h> #include <log_manager.h>
#include <hashtable.h>
extern int lm_enabled_logfiles_bitmask; extern int lm_enabled_logfiles_bitmask;

View File

@ -27,6 +27,7 @@
#include <gwbitmask.h> #include <gwbitmask.h>
#include <skygw_utils.h> #include <skygw_utils.h>
#include <log_manager.h> #include <log_manager.h>
#include <gw.h>
extern int lm_enabled_logfiles_bitmask; extern int lm_enabled_logfiles_bitmask;

View File

@ -21,6 +21,7 @@
#include <skygw_utils.h> #include <skygw_utils.h>
#include <log_manager.h> #include <log_manager.h>
#include <ctype.h> #include <ctype.h>
#include <mysql_client_server_protocol.h>
extern int lm_enabled_logfiles_bitmask; extern int lm_enabled_logfiles_bitmask;
/** /**

View File

@ -702,7 +702,7 @@ SERVICE *ptr;
* @param dcb DCB to print data to * @param dcb DCB to print data to
* @param service The service to print * @param service The service to print
*/ */
dprintService(DCB *dcb, SERVICE *service) void dprintService(DCB *dcb, SERVICE *service)
{ {
SERVER *server = service->databases; SERVER *server = service->databases;

View File

@ -128,7 +128,7 @@ MYSQL_MONITOR *handle;
handle->defaultPasswd = NULL; handle->defaultPasswd = NULL;
spinlock_init(&handle->lock); spinlock_init(&handle->lock);
} }
handle->tid = thread_start(monitorMain, handle); handle->tid = (THREAD)thread_start(monitorMain, handle);
return handle; return handle;
} }
@ -143,7 +143,7 @@ stopMonitor(void *arg)
MYSQL_MONITOR *handle = (MYSQL_MONITOR *)arg; MYSQL_MONITOR *handle = (MYSQL_MONITOR *)arg;
handle->shutdown = 1; handle->shutdown = 1;
thread_wait(handle->tid); thread_wait((void *)handle->tid);
} }
/** /**

View File

@ -283,6 +283,11 @@ static int gw_read_backend_event(DCB *dcb) {
} }
if (backend_protocol->state == MYSQL_AUTH_FAILED) { if (backend_protocol->state == MYSQL_AUTH_FAILED) {
/**
* protocol state won't change anymore,
* lock can be freed
*/
spinlock_release(&dcb->authlock);
spinlock_acquire(&dcb->delayqlock); spinlock_acquire(&dcb->delayqlock);
/*< /*<
* vraa : errorHandle * vraa : errorHandle
@ -351,7 +356,7 @@ static int gw_read_backend_event(DCB *dcb) {
/* close router_session */ /* close router_session */
router->closeSession(router_instance, rsession); router->closeSession(router_instance, rsession);
rc = 1; rc = 1;
goto return_with_lock; goto return_rc;
} }
else else
{ {