diff --git a/log_manager/log_manager.cc b/log_manager/log_manager.cc index ce8194598..b3b484601 100644 --- a/log_manager/log_manager.cc +++ b/log_manager/log_manager.cc @@ -167,8 +167,8 @@ static void* thr_filewriter_fun(void* data); static logfile_t* logmanager_get_logfile(logmanager_t* lm, logfile_id_t id); static bool logmanager_register(bool writep); static void logmanager_unregister(void); -static bool logmanager_init_nomutex(void** p_ctx, int argc, char* argv[]); -static void logmanager_done_nomutex(void** ctx); +static bool logmanager_init_nomutex(int argc, char* argv[]); +static void logmanager_done_nomutex(void); static int logmanager_write_log( logfile_id_t id, bool flush, @@ -232,7 +232,6 @@ const char* get_logpath_default(void) } static bool logmanager_init_nomutex( - void** p_ctx, int argc, char* argv[]) { @@ -283,7 +282,7 @@ static bool logmanager_init_nomutex( return_succp: if (err != 0) { /** This releases memory of all created objects */ - logmanager_done_nomutex(NULL); + logmanager_done_nomutex(); fprintf(stderr, "Initializing logmanager failed.\n"); } return succp; @@ -312,7 +311,6 @@ return_succp: * */ bool skygw_logmanager_init( - void** p_ctx, int argc, char* argv[]) { @@ -327,7 +325,7 @@ bool skygw_logmanager_init( goto return_succp; } - succp = logmanager_init_nomutex(p_ctx, argc, argv); + succp = logmanager_init_nomutex(argc, argv); return_succp: release_lock(&lmlock); @@ -337,8 +335,7 @@ return_succp: } -static void logmanager_done_nomutex( - void** ctx) +static void logmanager_done_nomutex(void) { int i; logfile_t* lf; @@ -391,7 +388,7 @@ static void logmanager_done_nomutex( */ void skygw_logmanager_exit(void) { - skygw_logmanager_done(NULL); + skygw_logmanager_done(); } /** @@ -411,8 +408,7 @@ void skygw_logmanager_exit(void) * @details Stops file writing thread, releases filewriter, and logfiles. * */ -void skygw_logmanager_done( - void** p_ctx) +void skygw_logmanager_done(void) { ss_dfprintf(stderr, ">> skygw_logmanager_done\n"); @@ -440,7 +436,7 @@ void skygw_logmanager_done( goto return_void; } ss_dassert(lm->lm_nlinks == 0); - logmanager_done_nomutex(p_ctx); + logmanager_done_nomutex(); return_void: release_lock(&lmlock); @@ -846,7 +842,6 @@ static blockbuf_t* blockbuf_init( int skygw_log_write_flush( - void* ctx, logfile_id_t id, char* str, ...) @@ -898,7 +893,6 @@ return_err: int skygw_log_write( - void* ctx, logfile_id_t id, char* str, ...) @@ -1021,7 +1015,7 @@ static bool logmanager_register( } if (lm == NULL) { - succp = logmanager_init_nomutex(NULL, 0, NULL); + succp = logmanager_init_nomutex(0, NULL); } } /** if logmanager existed or was succesfully restarted, increase link */ diff --git a/log_manager/log_manager.h b/log_manager/log_manager.h index 4acf131d7..a15913b41 100644 --- a/log_manager/log_manager.h +++ b/log_manager/log_manager.h @@ -45,22 +45,17 @@ typedef enum { UNINIT = 0, INIT, RUN, DONE } flat_obj_state_t; EXTERN_C_BLOCK_BEGIN -bool skygw_logmanager_init(void** buf, int argc, char* argv[]); -void skygw_logmanager_done(void** buf); +bool skygw_logmanager_init(int argc, char* argv[]); +void skygw_logmanager_done(void); void skygw_logmanager_exit(void); -/** not implemented yet */ -/** - * init write buffer list for private use for this client. Same as - * skygw_logmanager_init except that arguments are not set. - */ -bool skygw_log_init(void** writebuf); + /** * free private write buffer list */ -void skygw_log_done(void* writebuf); -int skygw_log_write(void* writebuf, logfile_id_t id, char* format, ...); +void skygw_log_done(void); +int skygw_log_write(logfile_id_t id, char* format, ...); int skygw_log_flush(logfile_id_t id); -int skygw_log_write_flush(void* writebuf, logfile_id_t id, char* format, ...); +int skygw_log_write_flush(logfile_id_t id, char* format, ...); @@ -75,29 +70,3 @@ const char* get_msg_suffix_default(void); const char* get_err_prefix_default(void); const char* get_err_suffix_default(void); const char* get_logpath_default(void); - -/* -bool logfile_write( - skygw_ctx_t* ctx, - logmgr_t* mgr, - logfile_id_t id, - char* msg); - -bool logfile_write_flush( - skygw_ctx_t* ctx, - logmgr_t* mgr, - logfile_id_t id, - char* msg); - -bool logfile_flush( - logmgr_t* mgr, - logfile_id_t id); - -bool logfile_init( - logmgr_t* mgr, - logfile_id_t id); - -void logfile_done( - logmgr_t* mgr, - logfile_id_t id); -*/ diff --git a/log_manager/test/testlog.c b/log_manager/test/testlog.c index 28c02ba01..fe3a0ce44 100644 --- a/log_manager/test/testlog.c +++ b/log_manager/test/testlog.c @@ -64,13 +64,12 @@ int main(int argc, char* argv[]) fprintf(stderr, "Couldn't register exit function.\n"); } - r = skygw_logmanager_init(NULL, argc, argv); + r = skygw_logmanager_init( argc, argv); ss_dassert(r); t = time(NULL); tm = *(localtime(&t)); - err = skygw_log_write_flush(NULL, - LOGFILE_ERROR, + err = skygw_log_write_flush(LOGFILE_ERROR, "%04d %02d/%02d %02d.%02d.%02d", tm.tm_year+1900, tm.tm_mon+1, @@ -79,57 +78,57 @@ int main(int argc, char* argv[]) tm.tm_min, tm.tm_sec); - skygw_logmanager_init(NULL, argc, argv); + skygw_logmanager_init( argc, argv); logstr = ("First write with flush."); - err = skygw_log_write_flush(NULL, LOGFILE_ERROR, logstr); + err = skygw_log_write_flush(LOGFILE_ERROR, logstr); logstr = ("Second write with flush."); - err = skygw_log_write_flush(NULL, LOGFILE_ERROR, logstr); + err = skygw_log_write_flush(LOGFILE_ERROR, logstr); logstr = ("Third write, no flush."); - err = skygw_log_write(NULL, LOGFILE_ERROR, logstr); + err = skygw_log_write(LOGFILE_ERROR, logstr); logstr = ("Fourth write, no flush. Next flush only."); - err = skygw_log_write(NULL, LOGFILE_ERROR, logstr); + err = skygw_log_write(LOGFILE_ERROR, logstr); err = skygw_log_flush(LOGFILE_ERROR); logstr = "My name is %s %d years and %d months."; - err = skygw_log_write(NULL, LOGFILE_TRACE, logstr, "TraceyTracey", 3, 7); + err = skygw_log_write(LOGFILE_TRACE, logstr, "TraceyTracey", 3, 7); skygw_log_flush(LOGFILE_TRACE); logstr = "My name is Tracey Tracey 47 years and 7 months."; - err = skygw_log_write(NULL, LOGFILE_TRACE, logstr); + err = skygw_log_write(LOGFILE_TRACE, logstr); logstr = "My name is Stacey %s"; - err = skygw_log_write_flush(NULL, LOGFILE_TRACE, logstr, " "); - skygw_logmanager_done(NULL); + err = skygw_log_write_flush(LOGFILE_TRACE, logstr, " "); + skygw_logmanager_done(); logstr = "My name is Philip"; - err = skygw_log_write(NULL, LOGFILE_TRACE, logstr); + err = skygw_log_write(LOGFILE_TRACE, logstr); logstr = "Philip."; - err = skygw_log_write(NULL, LOGFILE_TRACE, logstr); + err = skygw_log_write(LOGFILE_TRACE, logstr); logstr = "Ph%dlip."; - err = skygw_log_write(NULL, LOGFILE_TRACE, logstr, 1); + err = skygw_log_write(LOGFILE_TRACE, logstr, 1); - skygw_logmanager_init(NULL, argc, argv); + skygw_logmanager_init( argc, argv); logstr = ("A terrible error has occurred!"); - err = skygw_log_write_flush(NULL, LOGFILE_ERROR, logstr); + err = skygw_log_write_flush(LOGFILE_ERROR, logstr); logstr = ("Hi, how are you?"); - err = skygw_log_write(NULL, LOGFILE_MESSAGE, logstr); + err = skygw_log_write(LOGFILE_MESSAGE, logstr); logstr = ("I'm doing fine!"); - err = skygw_log_write(NULL, LOGFILE_MESSAGE, logstr); + err = skygw_log_write(LOGFILE_MESSAGE, logstr); logstr = ("Rather more surprising, at least at first sight, is the fact that a reference to a[i] can also be written as *(a+i). In evaluating a[i], C converts it to *(a+i) immediately; the two forms are equivalent. Applying the operators & to both parts of this equivalence, it follows that &a[i] and a+i are also identical: a+i is the address of the i-th element beyond a."); - err = skygw_log_write(NULL, LOGFILE_ERROR, logstr); + err = skygw_log_write(LOGFILE_ERROR, logstr); logstr = ("I was wondering, you know, it has been such a lovely weather whole morning and I thought that would you like to come to my place and have a little piece of cheese with us. Just me and my mom - and you, of course. Then, if you wish, we could listen to the radio and keep company for our little Steven, my mom's cat, you know."); - err = skygw_log_write(NULL, LOGFILE_MESSAGE, logstr); - skygw_logmanager_done(NULL); + err = skygw_log_write(LOGFILE_MESSAGE, logstr); + skygw_logmanager_done(); #if defined(TEST1) @@ -168,7 +167,7 @@ int main(int argc, char* argv[]) pthread_join(thr[i]->tid, NULL); } /** This is to release memory */ - skygw_logmanager_done(NULL); + skygw_logmanager_done(); simple_mutex_unlock(mtx); @@ -217,7 +216,7 @@ int main(int argc, char* argv[]) pthread_join(thr[i]->tid, NULL); } /** This is to release memory */ - skygw_logmanager_done(NULL); + skygw_logmanager_done(); simple_mutex_unlock(mtx); @@ -243,70 +242,70 @@ static void* thr_run( char* logstr; int err; - skygw_logmanager_init(NULL, 0, NULL); - skygw_logmanager_done(NULL); + skygw_logmanager_init( 0, NULL); + skygw_logmanager_done(); skygw_log_flush(LOGFILE_MESSAGE); logstr = ("Hi, how are you?"); - err = skygw_log_write(NULL, LOGFILE_MESSAGE, logstr); + err = skygw_log_write(LOGFILE_MESSAGE, logstr); ss_dassert(err == 0); - skygw_logmanager_done(NULL); + skygw_logmanager_done(); skygw_log_flush(LOGFILE_TRACE); skygw_log_flush(LOGFILE_MESSAGE); logstr = ("I was wondering, you know, it has been such a lovely weather whole morning and I thought that would you like to come to my place and have a little piece of cheese with us. Just me and my mom - and you, of course. Then, if you wish, we could listen to the radio and keep company for our little Steven, my mom's cat, you know."); ss_dassert(err == 0); - err = skygw_log_write(NULL, LOGFILE_MESSAGE, logstr); - skygw_logmanager_init(NULL, 0, NULL); + err = skygw_log_write(LOGFILE_MESSAGE, logstr); + skygw_logmanager_init( 0, NULL); logstr = ("Testing. One, two, three\n"); - err = skygw_log_write(NULL, LOGFILE_ERROR, logstr); + err = skygw_log_write(LOGFILE_ERROR, logstr); ss_dassert(err == 0); - skygw_logmanager_init(NULL, 0, NULL); - skygw_logmanager_init(NULL, 0, NULL); + skygw_logmanager_init( 0, NULL); + skygw_logmanager_init( 0, NULL); skygw_log_flush(LOGFILE_ERROR); logstr = ("For automatic and register variables, it is done each time the function or block is entered."); - err = skygw_log_write(NULL, LOGFILE_TRACE, logstr); + err = skygw_log_write(LOGFILE_TRACE, logstr); ss_dassert(err == 0); - skygw_logmanager_done(NULL); - skygw_logmanager_init(NULL, 0, NULL); + skygw_logmanager_done(); + skygw_logmanager_init( 0, NULL); logstr = ("Rather more surprising, at least at first sight, is the fact that a reference to a[i] can also be written as *(a+i). In evaluating a[i], C converts it to *(a+i) immediately; the two forms are equivalent. Applying the operatos & to both parts of this equivalence, it follows that &a[i] and a+i are also identical: a+i is the address of the i-th element beyond a."); - err = skygw_log_write(NULL, LOGFILE_ERROR, logstr); + err = skygw_log_write(LOGFILE_ERROR, logstr); ss_dassert(err == 0); - skygw_logmanager_init(NULL, 0, NULL); - skygw_logmanager_done(NULL); + skygw_logmanager_init( 0, NULL); + skygw_logmanager_done(); skygw_log_flush(LOGFILE_ERROR); - skygw_logmanager_done(NULL); - skygw_logmanager_done(NULL); + skygw_logmanager_done(); + skygw_logmanager_done(); logstr = ("..and you?"); - err = skygw_log_write(NULL, LOGFILE_MESSAGE, logstr); + err = skygw_log_write(LOGFILE_MESSAGE, logstr); ss_dassert(err == 0); - skygw_logmanager_init(NULL, 0, NULL); - skygw_logmanager_init(NULL, 0, NULL); + skygw_logmanager_init( 0, NULL); + skygw_logmanager_init( 0, NULL); logstr = ("For automatic and register variables, it is done each time the function or block is entered."); - err = skygw_log_write(NULL, LOGFILE_TRACE, logstr); + err = skygw_log_write(LOGFILE_TRACE, logstr); ss_dassert(err == 0); - skygw_logmanager_init(NULL, 0, NULL); + skygw_logmanager_init( 0, NULL); logstr = ("Rather more surprising, at least at first sight, is the fact that a reference to a[i] can also be written as *(a+i). In evaluating a[i], C converts it to *(a+i) immediately; the two forms are equivalent. Applying the operatos & to both parts of this equivalence, it follows that &a[i] and a+i are also identical: a+i is the address of the i-th element beyond a."); - err = skygw_log_write(NULL, LOGFILE_ERROR, logstr); + err = skygw_log_write(LOGFILE_ERROR, logstr); ss_dassert(err == 0); - skygw_logmanager_init(NULL, 0, NULL); + skygw_logmanager_init( 0, NULL); logstr = ("..... and you too?"); - err = skygw_log_write(NULL, LOGFILE_MESSAGE, logstr); + err = skygw_log_write(LOGFILE_MESSAGE, logstr); ss_dassert(err == 0); - skygw_logmanager_done(NULL); + skygw_logmanager_done(); skygw_log_flush(LOGFILE_TRACE); logstr = ("For automatic and register variables, it is done each time the function or block is entered."); - err = skygw_log_write(NULL, LOGFILE_TRACE, logstr); + err = skygw_log_write(LOGFILE_TRACE, logstr); ss_dassert(err == 0); - skygw_logmanager_done(NULL); + skygw_logmanager_done(); logstr = ("Testing. One, two, three, four\n"); - err = skygw_log_write(NULL, LOGFILE_ERROR, logstr); + err = skygw_log_write(LOGFILE_ERROR, logstr); ss_dassert(err == 0); - skygw_logmanager_init(NULL, 0, NULL); + skygw_logmanager_init( 0, NULL); logstr = ("Testing. One, two, three, .. where was I?\n"); - err = skygw_log_write(NULL, LOGFILE_ERROR, logstr); + err = skygw_log_write(LOGFILE_ERROR, logstr); ss_dassert(err == 0); - skygw_logmanager_init(NULL, 0, NULL); - skygw_logmanager_init(NULL, 0, NULL); - skygw_logmanager_done(NULL); + skygw_logmanager_init( 0, NULL); + skygw_logmanager_init( 0, NULL); + skygw_logmanager_done(); simple_mutex_lock(td->mtx, TRUE); *td->nactive -= 1; simple_mutex_unlock(td->mtx); @@ -355,8 +354,7 @@ static void* thr_run_morelog( for (i=0; i [gateway] threads=1 -# A series service definition -# Valid option are +# A series of service definition +# Valid options are # router= # servers=,,... # user= diff --git a/server/core/Makefile b/server/core/Makefile index 8fb068c78..e5d456500 100644 --- a/server/core/Makefile +++ b/server/core/Makefile @@ -103,6 +103,10 @@ depend: install: maxscale maxkeys maxpasswd @mkdir -p $(DEST)/bin install -D maxscale maxkeys maxpasswd $(DEST)/bin + THIS=`pwd` + cd $(DEST) + - `./maxkeys $(DEST)/MaxScale/etc/.secrets` + cd $(THIS) install -D $(MARIADB_SRC_PATH)/libmysqld/libmysqld.so.18 $(DEST)/lib include depend.mk diff --git a/server/core/adminusers.c b/server/core/adminusers.c index 5fcb3d221..a43a4b333 100644 --- a/server/core/adminusers.c +++ b/server/core/adminusers.c @@ -18,6 +18,7 @@ #include #include #include +#include #define _XOPEN_SOURCE #include #include @@ -48,7 +49,17 @@ static int admin_init = 0; static char *ADMIN_ERR_NOMEM = "Out of memory"; static char *ADMIN_ERR_FILEOPEN = "Unable to create password file"; static char *ADMIN_ERR_DUPLICATE = "Duplicate username specified"; +static char *ADMIN_ERR_USERNOTFOUND = "User not found"; +static char *ADMIN_ERR_AUTHENTICATION = "Authentication failed"; static char *ADMIN_ERR_FILEAPPEND = "Unable to append to password file"; +static char *ADMIN_ERR_PWDFILEOPEN = "Failed to open password file"; +static char *ADMIN_ERR_TMPFILEOPEN = "Failed to open temporary password file"; +static char *ADMIN_ERR_PWDFILEACCESS = "Failed to access password file"; +static char *ADMIN_ERR_DELLASTUSER = "Deleting user failed, deleting the " + "last user is forbidden"; +static char *ADMIN_SUCCESS = NULL; + +static const int LINELEN=80; /** * Admin Users initialisation @@ -142,15 +153,15 @@ char fname[1024], *home, *cpasswd; sprintf(fname, "/usr/local/skysql/MaxScale/etc/passwd"); if (users == NULL) { - skygw_log_write(NULL, LOGFILE_MESSAGE, "Create initial password file.\n"); + skygw_log_write( LOGFILE_MESSAGE, "Create initial password file.\n"); if ((users = users_alloc()) == NULL) return ADMIN_ERR_NOMEM; if ((fp = fopen(fname, "w")) == NULL) { - skygw_log_write(NULL, LOGFILE_ERROR, + skygw_log_write( LOGFILE_ERROR, "Unable to create password file %s.\n", fname); - return ADMIN_ERR_FILEOPEN; + return ADMIN_ERR_PWDFILEOPEN; } fclose(fp); } @@ -162,16 +173,161 @@ char fname[1024], *home, *cpasswd; users_add(users, uname, cpasswd); if ((fp = fopen(fname, "a")) == NULL) { - skygw_log_write(NULL, LOGFILE_ERROR, + skygw_log_write( LOGFILE_ERROR, "Unable to append to password file %s.\n", fname); return ADMIN_ERR_FILEAPPEND; } fprintf(fp, "%s:%s\n", uname, cpasswd); fclose(fp); - return NULL; + return ADMIN_SUCCESS; } + +/** + * Remove maxscale user from in-memory structure and from password file + * + * @param uname Name of the new user + * @param passwd Password for the new user + * @return NULL on success or an error string on failure + */ +char* admin_remove_user( + char* uname, + char* passwd) +{ + FILE* fp; + FILE* fp_tmp; + char fname[1024]; + char fname_tmp[1024]; + char* home; + char fusr[LINELEN]; + char fpwd[LINELEN]; + char line[LINELEN]; + fpos_t rpos; + int n_deleted; + + if (!admin_search_user(uname)) { + skygw_log_write( + LOGFILE_MESSAGE, + "Couldn't find user %s. Removing user failed", uname); + return ADMIN_ERR_USERNOTFOUND; + } + + if (admin_verify(uname, passwd) == 0) { + skygw_log_write( + LOGFILE_MESSAGE, + "Authentication failed, wrong user/password combination.\n" + "Removing user failed"); + return ADMIN_ERR_AUTHENTICATION; + } + + + /** Remove user from in-memory structure */ + n_deleted = users_delete(users, uname); + + if (n_deleted == 0) { + skygw_log_write( + LOGFILE_MESSAGE, + "Deleting the only user is forbidden. add new user " + "before deleting the old one.\n"); + return ADMIN_ERR_DELLASTUSER; + } + /** + * Open passwd file and remove user from the file. + */ + if ((home = getenv("MAXSCALE_HOME")) != NULL) { + sprintf(fname, "%s/etc/passwd", home); + sprintf(fname_tmp, "%s/etc/passwd_tmp", home); + } else { + sprintf(fname, "/usr/local/skysql/MaxScale/etc/passwd"); + sprintf(fname_tmp, "/usr/local/skysql/MaxScale/etc/passwd_tmp"); + } + /** + * Rewrite passwd file from memory. + */ + if ((fp = fopen(fname, "r")) == NULL) + { + int err = errno; + skygw_log_write( LOGFILE_ERROR, + "Unable to open password file %s : errno %d.\n" + "Removing user from file failed; it must be done manually.", + fname, + err); + return ADMIN_ERR_PWDFILEOPEN; + } + /** + * Open temporary passwd file. + */ + if ((fp_tmp = fopen(fname_tmp, "w")) == NULL) + { + int err = errno; + skygw_log_write( LOGFILE_ERROR, + "Unable to open tmp file %s : errno %d.\n" + "Removing user from passwd file failed; " + "it must be done manually.", + fname_tmp, + err); + fclose(fp); + return ADMIN_ERR_TMPFILEOPEN; + } + + /** + * Scan passwd and copy all but matching lines to temp file. + */ + if (fgetpos(fp, &rpos) != 0) { + int err = errno; + skygw_log_write( LOGFILE_ERROR, + "Unable to process passwd file %s : errno %d.\n" + "Removing user from file failed, and must be done manually.", + fname, + err); + return ADMIN_ERR_PWDFILEACCESS; + } + + while (fscanf(fp, "%[^:]:%s\n", fusr, fpwd) == 2) + { + /** + * Compare username what was found from passwd file. + * Unmatching lines are copied to tmp file. + */ + if (strncmp(uname, fusr, strlen(uname)+1) != 0) { + fsetpos(fp, &rpos); /** one step back */ + fgets(line, LINELEN, fp); + fputs(line, fp_tmp); + } + + if (fgetpos(fp, &rpos) != 0) { + int err = errno; + skygw_log_write( LOGFILE_ERROR, + "Unable to process passwd file %s : errno %d.\n" + "Removing user from file failed, and must be " + "done manually.", + fname, + err); + return ADMIN_ERR_PWDFILEACCESS; + } + } + fclose(fp); + /** + * Replace original passwd file with new. + */ + if (rename(fname_tmp, fname)) { + int err = errno; + skygw_log_write( LOGFILE_ERROR, + "Unable to rename new passwd file %s : errno %d.\n" + "Rename it to %s manually.", + fname_tmp, + err, + fname); + return ADMIN_ERR_PWDFILEACCESS; + } + + fclose(fp_tmp); + return ADMIN_SUCCESS; +} + + + /** * Check for existance of the user * @@ -179,7 +335,7 @@ char fname[1024], *home, *cpasswd; * @return Non-zero if the user exists */ int -admin_test_user(char *user) +admin_search_user(char *user) { initialise(); if (users == NULL) diff --git a/server/core/config.c b/server/core/config.c index 8b8b2e9c3..65b0048b5 100644 --- a/server/core/config.c +++ b/server/core/config.c @@ -170,7 +170,7 @@ CONFIG_CONTEXT *obj; { char *type = config_get_value(obj->parameters, "type"); if (type == NULL) - skygw_log_write(NULL, LOGFILE_ERROR, "Object %s has no type\n", obj->object); + skygw_log_write( LOGFILE_ERROR, "Object %s has no type\n", obj->object); else if (!strcmp(type, "service")) { char *router = config_get_value(obj->parameters, "router"); @@ -183,7 +183,7 @@ CONFIG_CONTEXT *obj; serviceSetUser(obj->element, user, auth); } else - skygw_log_write(NULL, LOGFILE_ERROR, "No router define for service '%s'\n", + skygw_log_write( LOGFILE_ERROR, "No router define for service '%s'\n", obj->object); } else if (!strcmp(type, "server")) @@ -399,7 +399,7 @@ SERVER *server; { char *type = config_get_value(obj->parameters, "type"); if (type == NULL) - skygw_log_write(NULL, LOGFILE_ERROR, "Object %s has no type\n", obj->object); + skygw_log_write( LOGFILE_ERROR, "Object %s has no type\n", obj->object); else if (!strcmp(type, "service")) { char *router = config_get_value(obj->parameters, "router"); @@ -422,7 +422,7 @@ SERVER *server; } } else - skygw_log_write(NULL, LOGFILE_ERROR, "No router defined for service '%s'\n", + skygw_log_write( LOGFILE_ERROR, "No router defined for service '%s'\n", obj->object); } else if (!strcmp(type, "server")) diff --git a/server/core/dbusers.c b/server/core/dbusers.c index 03cbad10d..0067ff28e 100644 --- a/server/core/dbusers.c +++ b/server/core/dbusers.c @@ -102,19 +102,19 @@ getUsers(SERVICE *service, struct users *users) serviceGetUser(service, &service_user, &service_passwd); /** multi-thread environment requires that thread init succeeds. */ if (mysql_thread_init()) { - skygw_log_write_flush(NULL, LOGFILE_ERROR, "ERROR : mysql_thread_init failed.\n"); + skygw_log_write_flush(LOGFILE_ERROR, "ERROR : mysql_thread_init failed.\n"); return -1; } con = mysql_init(NULL); if (con == NULL) { - skygw_log_write(NULL, LOGFILE_ERROR, "mysql_init: %s\n", mysql_error(con)); + skygw_log_write( LOGFILE_ERROR, "mysql_init: %s\n", mysql_error(con)); return -1; } if (mysql_options(con, MYSQL_OPT_USE_REMOTE_CONNECTION, NULL)) { - skygw_log_write_flush(NULL, LOGFILE_ERROR, "Fatal : failed to set external connection. " + skygw_log_write_flush(LOGFILE_ERROR, "Fatal : failed to set external connection. " "It is needed for backend server connections. Exiting.\n"); return -1; } @@ -139,15 +139,17 @@ getUsers(SERVICE *service, struct users *users) free(dpwd); if (server == NULL) { - skygw_log_write(NULL, LOGFILE_ERROR, - "Unable to find a to load user data from for service %s\n", + skygw_log_write( + LOGFILE_ERROR, + "Unable to get user data from backend database for service " + "%s. Missing server information.", service->name); mysql_close(con); return -1; } if (mysql_query(con, "SELECT user, password FROM mysql.user")) { - skygw_log_write(NULL, LOGFILE_ERROR, + skygw_log_write( LOGFILE_ERROR, "Loading users for service %s encountered error: %s\n", service->name, mysql_error(con)); mysql_close(con); @@ -157,7 +159,7 @@ getUsers(SERVICE *service, struct users *users) result = mysql_store_result(con); if (result == NULL) { - skygw_log_write(NULL, LOGFILE_ERROR, + skygw_log_write( LOGFILE_ERROR, "Loading users for service %s encountered error: %s\n", service->name, mysql_error(con)); mysql_close(con); diff --git a/server/core/dcb.c b/server/core/dcb.c index e1068a69d..89f3fe901 100644 --- a/server/core/dcb.c +++ b/server/core/dcb.c @@ -126,7 +126,7 @@ dcb_free(DCB *dcb) { if (dcb->state == DCB_STATE_ZOMBIE) { - skygw_log_write(NULL, LOGFILE_ERROR, "Call to free a DCB that is already a zombie.\n"); + skygw_log_write( LOGFILE_ERROR, "Call to free a DCB that is already a zombie.\n"); return; } @@ -144,7 +144,7 @@ dcb_free(DCB *dcb) { if (ptr == dcb) { - skygw_log_write(NULL, LOGFILE_ERROR, "Attempt to add DCB to zombie queue " + skygw_log_write( LOGFILE_ERROR, "Attempt to add DCB to zombie queue " "when it is already in the queue"); break; } @@ -285,7 +285,7 @@ GWPROTOCOL *funcs; if ((funcs = (GWPROTOCOL *)load_module(protocol, MODULE_PROTOCOL)) == NULL) { dcb_final_free(dcb); - skygw_log_write(NULL, LOGFILE_ERROR, + skygw_log_write( LOGFILE_ERROR, "Failed to load protocol module for %s, feee dcb %p\n", protocol, dcb); return NULL; } @@ -295,7 +295,7 @@ GWPROTOCOL *funcs; if ((dcb->fd = dcb->func.connect(dcb, server, session)) == -1) { dcb_final_free(dcb); - skygw_log_write(NULL, LOGFILE_ERROR, "Failed to connect to server %s:%d, free dcb %p\n", + skygw_log_write( LOGFILE_ERROR, "Failed to connect to server %s:%d, free dcb %p\n", server->name, server->port, dcb); return NULL; } diff --git a/server/core/depend.mk b/server/core/depend.mk deleted file mode 100644 index e1b039f88..000000000 --- a/server/core/depend.mk +++ /dev/null @@ -1,673 +0,0 @@ -atomic.o: atomic.c -buffer.o: buffer.c /usr/include/stdlib.h /usr/include/features.h \ - /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ - /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/bits/byteswap.h /usr/include/sys/types.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/time.h /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/alloca.h ../include/buffer.h ../include/atomic.h -spinlock.o: spinlock.c ../include/spinlock.h ../include/thread.h \ - /usr/include/pthread.h /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ - /usr/include/gnu/stubs-64.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ - /usr/include/sched.h /usr/include/bits/types.h \ - /usr/include/bits/typesizes.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/time.h /usr/include/bits/sched.h /usr/include/bits/time.h \ - /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/setjmp.h ../include/atomic.h -gateway.o: gateway.c ../include/gw.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ - /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ - /usr/include/bits/errno.h /usr/include/linux/errno.h \ - /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ - /usr/include/asm-generic/errno-base.h /usr/include/netdb.h \ - /usr/include/netinet/in.h /usr/include/stdint.h \ - /usr/include/bits/wchar.h /usr/include/sys/socket.h \ - /usr/include/sys/uio.h /usr/include/sys/types.h /usr/include/time.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/uio.h /usr/include/bits/socket.h \ - /usr/include/bits/sockaddr.h /usr/include/asm/socket.h \ - /usr/include/asm-generic/socket.h /usr/include/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/bits/in.h \ - /usr/include/rpc/netdb.h /usr/include/bits/netdb.h /usr/include/fcntl.h \ - /usr/include/bits/fcntl.h /usr/include/bits/stat.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ - /usr/include/bits/confname.h /usr/include/getopt.h /usr/include/syslog.h \ - /usr/include/sys/syslog.h /usr/include/bits/syslog-path.h \ - /usr/include/string.h /usr/include/stdlib.h \ - /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ - /usr/include/alloca.h /usr/include/pwd.h /usr/include/sys/epoll.h \ - /usr/include/signal.h /usr/include/bits/signum.h \ - /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \ - /usr/include/bits/sigcontext.h /usr/include/bits/sigstack.h \ - /usr/include/sys/ucontext.h /usr/include/bits/sigthread.h \ - /usr/include/sys/ioctl.h /usr/include/bits/ioctls.h \ - /usr/include/asm/ioctls.h /usr/include/asm-generic/ioctls.h \ - /usr/include/linux/ioctl.h /usr/include/asm/ioctl.h \ - /usr/include/asm-generic/ioctl.h /usr/include/bits/ioctl-types.h \ - /usr/include/sys/ttydefaults.h /usr/include/arpa/inet.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdbool.h \ - ../include/gateway_mysql.h ../include/dcb.h ../include/spinlock.h \ - ../include/thread.h /usr/include/pthread.h /usr/include/sched.h \ - /usr/include/bits/sched.h /usr/include/bits/setjmp.h ../include/buffer.h \ - ../include/gwbitmask.h ../include/mysql_protocol.h ../include/dcb.h \ - ../include/service.h ../include/server.h ../include/session.h \ - ../include/modules.h ../include/config.h ../include/poll.h \ - /home/skysql/mariadb-5.5.32/include/mysql.h \ - /home/skysql/mariadb-5.5.32/include/mysql_version.h \ - /home/skysql/mariadb-5.5.32/include/mysql_com.h \ - /home/skysql/mariadb-5.5.32/include/mysql_time.h \ - /home/skysql/mariadb-5.5.32/include/my_list.h \ - /home/skysql/mariadb-5.5.32/include/typelib.h \ - /home/skysql/mariadb-5.5.32/include/my_alloc.h ../include/monitor.h \ - /usr/include/sys/stat.h /home/skysql/workspace/utils/skygw_utils.h \ - /home/skysql/workspace/utils/skygw_types.h /usr/include/math.h \ - /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ - /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ - /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ - /usr/include/bits/mathcalls.h /home/skysql/workspace/utils/skygw_debug.h \ - /usr/include/assert.h /home/skysql/workspace/log_manager/log_manager.h -gateway_mysql_protocol.o: gateway_mysql_protocol.c ../include/gw.h \ - /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ - /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ - /usr/include/bits/errno.h /usr/include/linux/errno.h \ - /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ - /usr/include/asm-generic/errno-base.h /usr/include/netdb.h \ - /usr/include/netinet/in.h /usr/include/stdint.h \ - /usr/include/bits/wchar.h /usr/include/sys/socket.h \ - /usr/include/sys/uio.h /usr/include/sys/types.h /usr/include/time.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/uio.h /usr/include/bits/socket.h \ - /usr/include/bits/sockaddr.h /usr/include/asm/socket.h \ - /usr/include/asm-generic/socket.h /usr/include/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/bits/in.h \ - /usr/include/rpc/netdb.h /usr/include/bits/netdb.h /usr/include/fcntl.h \ - /usr/include/bits/fcntl.h /usr/include/bits/stat.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ - /usr/include/bits/confname.h /usr/include/getopt.h /usr/include/syslog.h \ - /usr/include/sys/syslog.h /usr/include/bits/syslog-path.h \ - /usr/include/string.h /usr/include/stdlib.h \ - /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ - /usr/include/alloca.h /usr/include/pwd.h /usr/include/sys/epoll.h \ - /usr/include/signal.h /usr/include/bits/signum.h \ - /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \ - /usr/include/bits/sigcontext.h /usr/include/bits/sigstack.h \ - /usr/include/sys/ucontext.h /usr/include/bits/sigthread.h \ - /usr/include/sys/ioctl.h /usr/include/bits/ioctls.h \ - /usr/include/asm/ioctls.h /usr/include/asm-generic/ioctls.h \ - /usr/include/linux/ioctl.h /usr/include/asm/ioctl.h \ - /usr/include/asm-generic/ioctl.h /usr/include/bits/ioctl-types.h \ - /usr/include/sys/ttydefaults.h /usr/include/arpa/inet.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdbool.h \ - ../include/gateway_mysql.h ../include/dcb.h ../include/spinlock.h \ - ../include/thread.h /usr/include/pthread.h /usr/include/sched.h \ - /usr/include/bits/sched.h /usr/include/bits/setjmp.h ../include/buffer.h \ - ../include/gwbitmask.h ../include/mysql_protocol.h ../include/dcb.h \ - ../include/session.h /usr/include/openssl/sha.h \ - /usr/include/openssl/e_os2.h /usr/include/openssl/opensslconf.h \ - /usr/include/openssl/opensslconf-x86_64.h -gw_utils.o: gw_utils.c ../include/gw.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ - /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ - /usr/include/bits/errno.h /usr/include/linux/errno.h \ - /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ - /usr/include/asm-generic/errno-base.h /usr/include/netdb.h \ - /usr/include/netinet/in.h /usr/include/stdint.h \ - /usr/include/bits/wchar.h /usr/include/sys/socket.h \ - /usr/include/sys/uio.h /usr/include/sys/types.h /usr/include/time.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/uio.h /usr/include/bits/socket.h \ - /usr/include/bits/sockaddr.h /usr/include/asm/socket.h \ - /usr/include/asm-generic/socket.h /usr/include/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/bits/in.h \ - /usr/include/rpc/netdb.h /usr/include/bits/netdb.h /usr/include/fcntl.h \ - /usr/include/bits/fcntl.h /usr/include/bits/stat.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ - /usr/include/bits/confname.h /usr/include/getopt.h /usr/include/syslog.h \ - /usr/include/sys/syslog.h /usr/include/bits/syslog-path.h \ - /usr/include/string.h /usr/include/stdlib.h \ - /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ - /usr/include/alloca.h /usr/include/pwd.h /usr/include/sys/epoll.h \ - /usr/include/signal.h /usr/include/bits/signum.h \ - /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \ - /usr/include/bits/sigcontext.h /usr/include/bits/sigstack.h \ - /usr/include/sys/ucontext.h /usr/include/bits/sigthread.h \ - /usr/include/sys/ioctl.h /usr/include/bits/ioctls.h \ - /usr/include/asm/ioctls.h /usr/include/asm-generic/ioctls.h \ - /usr/include/linux/ioctl.h /usr/include/asm/ioctl.h \ - /usr/include/asm-generic/ioctl.h /usr/include/bits/ioctl-types.h \ - /usr/include/sys/ttydefaults.h /usr/include/arpa/inet.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdbool.h \ - ../include/gateway_mysql.h ../include/dcb.h ../include/spinlock.h \ - ../include/thread.h /usr/include/pthread.h /usr/include/sched.h \ - /usr/include/bits/sched.h /usr/include/bits/setjmp.h ../include/buffer.h \ - ../include/gwbitmask.h ../include/mysql_protocol.h ../include/dcb.h \ - ../include/session.h -utils.o: utils.c ../include/gw.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ - /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ - /usr/include/bits/errno.h /usr/include/linux/errno.h \ - /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ - /usr/include/asm-generic/errno-base.h /usr/include/netdb.h \ - /usr/include/netinet/in.h /usr/include/stdint.h \ - /usr/include/bits/wchar.h /usr/include/sys/socket.h \ - /usr/include/sys/uio.h /usr/include/sys/types.h /usr/include/time.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/uio.h /usr/include/bits/socket.h \ - /usr/include/bits/sockaddr.h /usr/include/asm/socket.h \ - /usr/include/asm-generic/socket.h /usr/include/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/bits/in.h \ - /usr/include/rpc/netdb.h /usr/include/bits/netdb.h /usr/include/fcntl.h \ - /usr/include/bits/fcntl.h /usr/include/bits/stat.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ - /usr/include/bits/confname.h /usr/include/getopt.h /usr/include/syslog.h \ - /usr/include/sys/syslog.h /usr/include/bits/syslog-path.h \ - /usr/include/string.h /usr/include/stdlib.h \ - /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ - /usr/include/alloca.h /usr/include/pwd.h /usr/include/sys/epoll.h \ - /usr/include/signal.h /usr/include/bits/signum.h \ - /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \ - /usr/include/bits/sigcontext.h /usr/include/bits/sigstack.h \ - /usr/include/sys/ucontext.h /usr/include/bits/sigthread.h \ - /usr/include/sys/ioctl.h /usr/include/bits/ioctls.h \ - /usr/include/asm/ioctls.h /usr/include/asm-generic/ioctls.h \ - /usr/include/linux/ioctl.h /usr/include/asm/ioctl.h \ - /usr/include/asm-generic/ioctl.h /usr/include/bits/ioctl-types.h \ - /usr/include/sys/ttydefaults.h /usr/include/arpa/inet.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdbool.h \ - ../include/gateway_mysql.h ../include/dcb.h ../include/spinlock.h \ - ../include/thread.h /usr/include/pthread.h /usr/include/sched.h \ - /usr/include/bits/sched.h /usr/include/bits/setjmp.h ../include/buffer.h \ - ../include/gwbitmask.h ../include/mysql_protocol.h ../include/dcb.h \ - ../include/session.h ../include/mysql_protocol.h \ - /usr/include/openssl/sha.h /usr/include/openssl/e_os2.h \ - /usr/include/openssl/opensslconf.h \ - /usr/include/openssl/opensslconf-x86_64.h ../include/poll.h \ - /home/skysql/workspace/utils/skygw_utils.h \ - /home/skysql/workspace/utils/skygw_types.h /usr/include/math.h \ - /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ - /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ - /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ - /usr/include/bits/mathcalls.h /home/skysql/workspace/utils/skygw_debug.h \ - /usr/include/assert.h /home/skysql/workspace/log_manager/log_manager.h -dcb.o: dcb.c /usr/include/stdio.h /usr/include/features.h \ - /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ - /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/bits/waitflags.h \ - /usr/include/bits/waitstatus.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ - /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h \ - /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ - /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h ../include/dcb.h \ - ../include/spinlock.h ../include/thread.h /usr/include/pthread.h \ - /usr/include/sched.h /usr/include/bits/sched.h \ - /usr/include/bits/setjmp.h ../include/buffer.h ../include/gwbitmask.h \ - ../include/server.h ../include/session.h ../include/service.h \ - ../include/modules.h ../include/router.h /usr/include/errno.h \ - /usr/include/bits/errno.h /usr/include/linux/errno.h \ - /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ - /usr/include/asm-generic/errno-base.h ../include/gw.h \ - /usr/include/ctype.h /usr/include/netdb.h /usr/include/netinet/in.h \ - /usr/include/stdint.h /usr/include/bits/wchar.h \ - /usr/include/sys/socket.h /usr/include/sys/uio.h /usr/include/bits/uio.h \ - /usr/include/bits/socket.h /usr/include/bits/sockaddr.h \ - /usr/include/asm/socket.h /usr/include/asm-generic/socket.h \ - /usr/include/asm/sockios.h /usr/include/asm-generic/sockios.h \ - /usr/include/bits/in.h /usr/include/rpc/netdb.h \ - /usr/include/bits/netdb.h /usr/include/fcntl.h /usr/include/bits/fcntl.h \ - /usr/include/bits/stat.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ - /usr/include/bits/confname.h /usr/include/getopt.h /usr/include/syslog.h \ - /usr/include/sys/syslog.h /usr/include/bits/syslog-path.h \ - /usr/include/pwd.h /usr/include/sys/epoll.h /usr/include/signal.h \ - /usr/include/bits/signum.h /usr/include/bits/siginfo.h \ - /usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \ - /usr/include/bits/sigstack.h /usr/include/sys/ucontext.h \ - /usr/include/bits/sigthread.h /usr/include/sys/ioctl.h \ - /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ - /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ - /usr/include/asm/ioctl.h /usr/include/asm-generic/ioctl.h \ - /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \ - /usr/include/arpa/inet.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdbool.h \ - ../include/gateway_mysql.h ../include/mysql_protocol.h ../include/dcb.h \ - ../include/poll.h ../include/atomic.h \ - /home/skysql/workspace/utils/skygw_utils.h \ - /home/skysql/workspace/utils/skygw_types.h /usr/include/math.h \ - /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ - /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ - /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ - /usr/include/bits/mathcalls.h /home/skysql/workspace/utils/skygw_debug.h \ - /usr/include/assert.h /home/skysql/workspace/log_manager/log_manager.h -load_utils.o: load_utils.c /usr/include/sys/param.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/limits.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/syslimits.h \ - /usr/include/limits.h /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ - /usr/include/gnu/stubs-64.h /usr/include/bits/posix1_lim.h \ - /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/bits/posix2_lim.h /usr/include/linux/param.h \ - /usr/include/asm/param.h /usr/include/asm-generic/param.h \ - /usr/include/sys/types.h /usr/include/bits/types.h \ - /usr/include/bits/typesizes.h /usr/include/time.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/bits/byteswap.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h \ - /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ - /usr/include/bits/pthreadtypes.h /usr/include/stdio.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/bits/waitflags.h \ - /usr/include/bits/waitstatus.h /usr/include/alloca.h \ - /usr/include/unistd.h /usr/include/bits/posix_opt.h \ - /usr/include/bits/environments.h /usr/include/bits/confname.h \ - /usr/include/getopt.h /usr/include/string.h /usr/include/xlocale.h \ - /usr/include/dlfcn.h /usr/include/bits/dlfcn.h ../include/modules.h \ - ../include/dcb.h ../include/spinlock.h ../include/thread.h \ - /usr/include/pthread.h /usr/include/sched.h /usr/include/bits/sched.h \ - /usr/include/bits/setjmp.h ../include/buffer.h ../include/gwbitmask.h \ - /home/skysql/workspace/utils/skygw_utils.h \ - /home/skysql/workspace/utils/skygw_types.h /usr/include/math.h \ - /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ - /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ - /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ - /usr/include/bits/mathcalls.h /home/skysql/workspace/utils/skygw_debug.h \ - /usr/include/assert.h /home/skysql/workspace/log_manager/log_manager.h -session.o: session.c /usr/include/stdio.h /usr/include/features.h \ - /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ - /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/bits/waitflags.h \ - /usr/include/bits/waitstatus.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ - /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h \ - /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ - /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/unistd.h /usr/include/bits/posix_opt.h \ - /usr/include/bits/environments.h /usr/include/bits/confname.h \ - /usr/include/getopt.h /usr/include/string.h /usr/include/xlocale.h \ - ../include/session.h ../include/service.h ../include/spinlock.h \ - ../include/thread.h /usr/include/pthread.h /usr/include/sched.h \ - /usr/include/bits/sched.h /usr/include/bits/setjmp.h ../include/dcb.h \ - ../include/buffer.h ../include/gwbitmask.h ../include/server.h \ - ../include/router.h ../include/atomic.h -service.o: service.c /usr/include/stdio.h /usr/include/features.h \ - /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ - /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/bits/waitflags.h \ - /usr/include/bits/waitstatus.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ - /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h \ - /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ - /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h ../include/session.h \ - ../include/service.h ../include/spinlock.h ../include/thread.h \ - /usr/include/pthread.h /usr/include/sched.h /usr/include/bits/sched.h \ - /usr/include/bits/setjmp.h ../include/dcb.h ../include/buffer.h \ - ../include/gwbitmask.h ../include/server.h ../include/router.h \ - ../include/modules.h ../include/users.h ../include/hashtable.h \ - ../include/atomic.h ../include/dbusers.h ../include/poll.h \ - /home/skysql/workspace/utils/skygw_utils.h \ - /home/skysql/workspace/utils/skygw_types.h /usr/include/math.h \ - /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ - /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ - /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ - /usr/include/bits/mathcalls.h /home/skysql/workspace/utils/skygw_debug.h \ - /usr/include/assert.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ - /usr/include/bits/confname.h /usr/include/getopt.h \ - /home/skysql/workspace/log_manager/log_manager.h -server.o: server.c /usr/include/stdio.h /usr/include/features.h \ - /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ - /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/bits/waitflags.h \ - /usr/include/bits/waitstatus.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ - /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h \ - /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ - /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h ../include/session.h \ - ../include/server.h ../include/dcb.h ../include/spinlock.h \ - ../include/thread.h /usr/include/pthread.h /usr/include/sched.h \ - /usr/include/bits/sched.h /usr/include/bits/setjmp.h ../include/buffer.h \ - ../include/gwbitmask.h /home/skysql/workspace/utils/skygw_utils.h \ - /home/skysql/workspace/utils/skygw_types.h /usr/include/math.h \ - /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ - /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ - /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ - /usr/include/bits/mathcalls.h /home/skysql/workspace/utils/skygw_debug.h \ - /usr/include/assert.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ - /usr/include/bits/confname.h /usr/include/getopt.h \ - /home/skysql/workspace/log_manager/log_manager.h -poll.o: poll.c /usr/include/stdio.h /usr/include/features.h \ - /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ - /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/string.h /usr/include/xlocale.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ - /usr/include/bits/confname.h /usr/include/getopt.h /usr/include/stdlib.h \ - /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/bits/byteswap.h /usr/include/sys/types.h \ - /usr/include/time.h /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/alloca.h /usr/include/sys/epoll.h /usr/include/stdint.h \ - /usr/include/bits/wchar.h ../include/poll.h ../include/dcb.h \ - ../include/spinlock.h ../include/thread.h /usr/include/pthread.h \ - /usr/include/sched.h /usr/include/bits/sched.h \ - /usr/include/bits/setjmp.h ../include/buffer.h ../include/gwbitmask.h \ - ../include/atomic.h -config.o: config.c /usr/include/stdio.h /usr/include/features.h \ - /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ - /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/string.h /usr/include/xlocale.h /usr/include/stdlib.h \ - /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/bits/byteswap.h /usr/include/sys/types.h \ - /usr/include/time.h /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/alloca.h ../inih/ini.h ../include/config.h \ - ../include/service.h ../include/spinlock.h ../include/thread.h \ - /usr/include/pthread.h /usr/include/sched.h /usr/include/bits/sched.h \ - /usr/include/bits/setjmp.h ../include/dcb.h ../include/buffer.h \ - ../include/gwbitmask.h ../include/server.h ../include/users.h \ - ../include/hashtable.h ../include/atomic.h ../include/monitor.h \ - /home/skysql/workspace/utils/skygw_utils.h \ - /home/skysql/workspace/utils/skygw_types.h /usr/include/math.h \ - /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ - /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ - /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ - /usr/include/bits/mathcalls.h /home/skysql/workspace/utils/skygw_debug.h \ - /usr/include/assert.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ - /usr/include/bits/confname.h /usr/include/getopt.h \ - /home/skysql/workspace/log_manager/log_manager.h -users.o: users.c /usr/include/stdio.h /usr/include/features.h \ - /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ - /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/bits/waitflags.h \ - /usr/include/bits/waitstatus.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ - /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h \ - /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ - /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h ../include/users.h \ - ../include/hashtable.h ../include/spinlock.h ../include/thread.h \ - /usr/include/pthread.h /usr/include/sched.h /usr/include/bits/sched.h \ - /usr/include/bits/setjmp.h ../include/atomic.h ../include/dcb.h \ - ../include/buffer.h ../include/gwbitmask.h -hashtable.o: hashtable.c /usr/include/stdio.h /usr/include/features.h \ - /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ - /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/bits/waitflags.h \ - /usr/include/bits/waitstatus.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ - /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h \ - /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ - /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h ../include/hashtable.h \ - ../include/spinlock.h ../include/thread.h /usr/include/pthread.h \ - /usr/include/sched.h /usr/include/bits/sched.h \ - /usr/include/bits/setjmp.h ../include/atomic.h ../include/dcb.h \ - ../include/buffer.h ../include/gwbitmask.h -dbusers.o: dbusers.c /usr/include/stdio.h /usr/include/features.h \ - /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ - /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /home/skysql/mariadb-5.5.32/include/mysql.h /usr/include/sys/types.h \ - /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/bits/byteswap.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h \ - /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ - /usr/include/bits/pthreadtypes.h \ - /home/skysql/mariadb-5.5.32/include/mysql_version.h \ - /home/skysql/mariadb-5.5.32/include/mysql_com.h \ - /home/skysql/mariadb-5.5.32/include/mysql_time.h \ - /home/skysql/mariadb-5.5.32/include/my_list.h \ - /home/skysql/mariadb-5.5.32/include/typelib.h \ - /home/skysql/mariadb-5.5.32/include/my_alloc.h ../include/dcb.h \ - ../include/spinlock.h ../include/thread.h /usr/include/pthread.h \ - /usr/include/sched.h /usr/include/bits/sched.h /usr/include/xlocale.h \ - /usr/include/bits/setjmp.h ../include/buffer.h ../include/gwbitmask.h \ - ../include/service.h ../include/server.h ../include/users.h \ - ../include/hashtable.h ../include/atomic.h \ - /home/skysql/workspace/utils/skygw_utils.h \ - /home/skysql/workspace/utils/skygw_types.h /usr/include/math.h \ - /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ - /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ - /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ - /usr/include/bits/mathcalls.h /home/skysql/workspace/utils/skygw_debug.h \ - /usr/include/assert.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ - /usr/include/bits/confname.h /usr/include/getopt.h \ - /home/skysql/workspace/log_manager/log_manager.h ../include/secrets.h \ - /usr/include/string.h /usr/include/stdlib.h \ - /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ - /usr/include/alloca.h /usr/include/sys/stat.h /usr/include/bits/stat.h \ - /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/errno.h \ - /usr/include/bits/errno.h /usr/include/linux/errno.h \ - /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ - /usr/include/asm-generic/errno-base.h /usr/include/openssl/aes.h \ - /usr/include/openssl/opensslconf.h \ - /usr/include/openssl/opensslconf-x86_64.h -thread.o: thread.c ../include/thread.h /usr/include/pthread.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ - /usr/include/gnu/stubs-64.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ - /usr/include/sched.h /usr/include/bits/types.h \ - /usr/include/bits/typesizes.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/time.h /usr/include/bits/sched.h /usr/include/bits/time.h \ - /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/setjmp.h -gwbitmask.o: gwbitmask.c /usr/include/stdlib.h /usr/include/features.h \ - /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ - /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/bits/byteswap.h /usr/include/sys/types.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/time.h /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/alloca.h /usr/include/string.h /usr/include/xlocale.h \ - ../include/gwbitmask.h ../include/spinlock.h ../include/thread.h \ - /usr/include/pthread.h /usr/include/sched.h /usr/include/bits/sched.h \ - /usr/include/bits/setjmp.h -monitor.o: monitor.c /usr/include/stdio.h /usr/include/features.h \ - /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ - /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/bits/waitflags.h \ - /usr/include/bits/waitstatus.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ - /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h \ - /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ - /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h ../include/monitor.h \ - ../include/server.h ../include/dcb.h ../include/spinlock.h \ - ../include/thread.h /usr/include/pthread.h /usr/include/sched.h \ - /usr/include/bits/sched.h /usr/include/bits/setjmp.h ../include/buffer.h \ - ../include/gwbitmask.h ../include/modules.h \ - /home/skysql/workspace/utils/skygw_utils.h \ - /home/skysql/workspace/utils/skygw_types.h /usr/include/math.h \ - /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ - /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ - /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ - /usr/include/bits/mathcalls.h /home/skysql/workspace/utils/skygw_debug.h \ - /usr/include/assert.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ - /usr/include/bits/confname.h /usr/include/getopt.h \ - /home/skysql/workspace/log_manager/log_manager.h -adminusers.o: adminusers.c /usr/include/stdio.h /usr/include/features.h \ - /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ - /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/bits/waitflags.h \ - /usr/include/bits/waitstatus.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ - /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h \ - /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ - /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ - /usr/include/bits/confname.h /usr/include/getopt.h /usr/include/crypt.h \ - ../include/users.h ../include/hashtable.h ../include/spinlock.h \ - ../include/thread.h /usr/include/pthread.h /usr/include/sched.h \ - /usr/include/bits/sched.h /usr/include/bits/setjmp.h ../include/atomic.h \ - ../include/dcb.h ../include/buffer.h ../include/gwbitmask.h \ - ../include/adminusers.h /home/skysql/workspace/utils/skygw_utils.h \ - /home/skysql/workspace/utils/skygw_types.h /usr/include/math.h \ - /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ - /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ - /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ - /usr/include/bits/mathcalls.h /home/skysql/workspace/utils/skygw_debug.h \ - /usr/include/assert.h /home/skysql/workspace/log_manager/log_manager.h -secrets.o: secrets.c ../include/secrets.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ - /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/string.h /usr/include/xlocale.h /usr/include/stdlib.h \ - /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/bits/byteswap.h /usr/include/sys/types.h \ - /usr/include/time.h /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/alloca.h /usr/include/sys/stat.h /usr/include/bits/stat.h \ - /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/errno.h \ - /usr/include/bits/errno.h /usr/include/linux/errno.h \ - /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ - /usr/include/asm-generic/errno-base.h /usr/include/openssl/aes.h \ - /usr/include/openssl/opensslconf.h \ - /usr/include/openssl/opensslconf-x86_64.h \ - /home/skysql/workspace/utils/skygw_utils.h \ - /home/skysql/workspace/utils/skygw_types.h /usr/include/math.h \ - /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ - /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ - /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ - /usr/include/bits/mathcalls.h /home/skysql/workspace/utils/skygw_debug.h \ - /usr/include/assert.h /usr/include/pthread.h /usr/include/sched.h \ - /usr/include/bits/sched.h /usr/include/bits/setjmp.h \ - /usr/include/unistd.h /usr/include/bits/posix_opt.h \ - /usr/include/bits/environments.h /usr/include/bits/confname.h \ - /usr/include/getopt.h /home/skysql/workspace/log_manager/log_manager.h \ - /usr/include/ctype.h diff --git a/server/core/gateway.c b/server/core/gateway.c index 0bc85373e..08ebd32cd 100644 --- a/server/core/gateway.c +++ b/server/core/gateway.c @@ -90,14 +90,14 @@ static char datadir[1024] = ""; */ static void sighup_handler (int i) { - skygw_log_write(NULL, LOGFILE_MESSAGE, "Refreshing configuration following SIGHUP\n"); + skygw_log_write( LOGFILE_MESSAGE, "Refreshing configuration following SIGHUP\n"); config_reload(); } static void sigterm_handler (int i) { extern void shutdown_gateway(); - skygw_log_write(NULL, LOGFILE_ERROR, "Signal SIGTERM %i received ...Exiting!\n", i); + skygw_log_write( LOGFILE_ERROR, "Signal SIGTERM %i received ...Exiting!\n", i); shutdown_gateway(); } @@ -110,7 +110,7 @@ static void signal_set (int sig, void (*handler)(int)) { sigact.sa_handler = handler; GW_NOINTR_CALL(err = sigaction(sig, &sigact, NULL)); if (err < 0) { - skygw_log_write(NULL, LOGFILE_ERROR,"sigaction() error %s\n", strerror(errno)); + skygw_log_write( LOGFILE_ERROR,"sigaction() error %s\n", strerror(errno)); exit(1); } } @@ -261,13 +261,13 @@ char ddopt[1024]; if (s==10) { skygw_log_write( - NULL, LOGFILE_ERROR, + LOGFILE_ERROR, "Fatal : missing file name. \n" "Unable to find a MaxScale configuration file, " "either install one in /etc/MaxScale.cnf, " "$MAXSCALE_HOME/etc/MaxScale.cnf " - "or use the -c option with configuration file name. " - "Exiting.\n"); + "or use the -c option with configuration file name." + " Exiting.\n"); } cnf_file = &argv[n][s]; } @@ -280,7 +280,7 @@ char ddopt[1024]; if (daemon_mode == 1) { if (sigfillset(&sigset) != 0) { - skygw_log_write(NULL, + skygw_log_write( LOGFILE_ERROR, "sigfillset() error %s\n", strerror(errno)); @@ -288,21 +288,21 @@ char ddopt[1024]; } if (sigdelset(&sigset, SIGHUP) != 0) { - skygw_log_write(NULL, + skygw_log_write( LOGFILE_ERROR, "sigdelset(SIGHUP) error %s\n", strerror(errno)); } if (sigdelset(&sigset, SIGTERM) != 0) { - skygw_log_write(NULL, + skygw_log_write( LOGFILE_ERROR, "sigdelset(SIGTERM) error %s\n", strerror(errno)); } if (sigprocmask(SIG_SETMASK, &sigset, NULL) != 0) { - skygw_log_write(NULL, + skygw_log_write( LOGFILE_ERROR, "sigprocmask() error %s\n", strerror(errno)); @@ -366,12 +366,12 @@ char ddopt[1024]; argv[1] = "-g"; argv[2] = buf; argv[3] = NULL; - skygw_logmanager_init(NULL, 3, argv); + skygw_logmanager_init(3, argv); } if (cnf_file == NULL) { - skygw_log_write( - NULL, LOGFILE_ERROR, + skygw_log_write_flush( + LOGFILE_ERROR, "Fatal : Unable to find a MaxScale configuration file, either " "install one in /etc/MaxScale.cnf, $MAXSCALE_HOME/etc/MaxScale.cnf " "or use the -c option. Exiting.\n"); @@ -391,12 +391,11 @@ char ddopt[1024]; if (mysql_library_init(num_elements, server_options, server_groups)) { skygw_log_write_flush( - NULL, LOGFILE_ERROR, "Fatal : mysql_library_init failed, %s. This is mandatory " "component, required by router services and the MaxScale core, " "the MaxScale can't continue without it. Exiting.\n" - "%s : %d\n", + "%s : %d", mysql_error(NULL), __FILE__, __LINE__); @@ -405,25 +404,28 @@ char ddopt[1024]; if (!config_load(cnf_file)) { - skygw_log_write(NULL, - LOGFILE_ERROR, - "Failed to load MaxScale configuration file %s\n", cnf_file); + skygw_log_write_flush( + LOGFILE_ERROR, + "Failed to load MaxScale configuration file %s", cnf_file); exit(1); } - skygw_log_write(NULL, LOGFILE_MESSAGE, "SkySQL MaxScale (C) SkySQL Ab 2013\n"); - skygw_log_write_flush(NULL, - LOGFILE_MESSAGE, - "MaxScale is starting, PID %i\n", - getpid()); - + skygw_log_write( + LOGFILE_MESSAGE, + "SkySQL MaxScale (C) SkySQL Ab 2013"); + skygw_log_write( + LOGFILE_MESSAGE, + "MaxScale is starting, PID %i", + getpid()); + poll_init(); - + /* * Start the services that were created above */ n_services = serviceStartAll(); - skygw_log_write(NULL, LOGFILE_MESSAGE, "Started %i services\n", getpid()); + skygw_log_write_flush(LOGFILE_MESSAGE, + "Start modules completed"); /* * Start the polling threads, note this is one less than is @@ -440,7 +442,10 @@ char ddopt[1024]; /* Stop all the monitors */ monitorStopAll(); - skygw_log_write(NULL, LOGFILE_MESSAGE, "MaxScale shutdown, PID %i\n", getpid()); + skygw_log_write( + LOGFILE_MESSAGE, + "MaxScale shutdown, PID %i\n", + getpid()); return 0; } // End of main diff --git a/server/core/hashtable.c b/server/core/hashtable.c index cc20a1a27..15a1c3f3e 100644 --- a/server/core/hashtable.c +++ b/server/core/hashtable.c @@ -227,8 +227,14 @@ HASHENTRIES *entry, *ptr; table->entries[hashkey % table->hashsize] = entry->next; table->freefn(entry->key); table->freefn(entry->value); - entry->key = entry->next->key; - entry->value = entry->next->value; + + if (entry->next != NULL) { + entry->key = entry->next->key; + entry->value = entry->next->value; + } else { + entry->key = NULL; + entry->value = NULL; + } free(entry); } else diff --git a/server/core/load_utils.c b/server/core/load_utils.c index eeb14f944..47897d00e 100644 --- a/server/core/load_utils.c +++ b/server/core/load_utils.c @@ -81,22 +81,25 @@ MODULES *mod; sprintf(fname, "%s/modules/lib%s.so", home, module); if (access(fname, F_OK) == -1) { - skygw_log_write(NULL, LOGFILE_ERROR, + skygw_log_write( LOGFILE_ERROR, "Unable to find library for module: %s\n", module); return NULL; } } if ((dlhandle = dlopen(fname, RTLD_NOW|RTLD_LOCAL)) == NULL) { - skygw_log_write(NULL, LOGFILE_ERROR, + skygw_log_write( LOGFILE_ERROR, "Unable to load library for module: %s, %s\n", module, dlerror()); return NULL; } if ((sym = dlsym(dlhandle, "version")) == NULL) { - skygw_log_write(NULL, LOGFILE_ERROR, - "Version interface not supported by module: %s, %s\n", module, dlerror()); + skygw_log_write_flush( + LOGFILE_ERROR, + "Version interface not supported by module: %s, %s\n", + module, + dlerror()); dlclose(dlhandle); return NULL; } @@ -114,15 +117,22 @@ MODULES *mod; if ((sym = dlsym(dlhandle, "GetModuleObject")) == NULL) { - skygw_log_write(NULL, LOGFILE_ERROR, - "Expected entry point interface missing from module: %s, %s\n", module, dlerror()); + skygw_log_write_flush( + LOGFILE_ERROR, + "Expected entry point interface missing from module: " + "%s, %s\n", + module, + dlerror()); dlclose(dlhandle); return NULL; } ep = sym; modobj = ep(); - skygw_log_write(NULL, LOGFILE_MESSAGE, "Loaded module %s: %s\n", module, version); + skygw_log_write_flush(LOGFILE_MESSAGE, + "Loaded module %s: %s\n", + module, + version); register_module(module, type, dlhandle, version, modobj); } else diff --git a/server/core/monitor.c b/server/core/monitor.c index 36b9c294e..e717e500c 100644 --- a/server/core/monitor.c +++ b/server/core/monitor.c @@ -61,7 +61,7 @@ MONITOR *mon; mon->name = strdup(name); if ((mon->module = load_module(module, MODULE_MONITOR)) == NULL) { - skygw_log_write(NULL, LOGFILE_ERROR, "Unable to load monitor module '%s'\n", name); + skygw_log_write( LOGFILE_ERROR, "Unable to load monitor module '%s'\n", name); free(mon->name); free(mon); return NULL; diff --git a/server/core/secrets.c b/server/core/secrets.c index fb83fc54d..f05b2bfb8 100644 --- a/server/core/secrets.c +++ b/server/core/secrets.c @@ -70,31 +70,31 @@ int fd; /* open secret file */ if ((fd = open(secret_file, O_RDONLY)) < 0) { - skygw_log_write(NULL, LOGFILE_ERROR, "secrets_readKeys, failed opening secret file [%s]. Error %i, %s\n", secret_file, errno, strerror(errno)); + skygw_log_write( LOGFILE_ERROR, "secrets_readKeys, failed opening secret file [%s]. Error %i, %s\n", secret_file, errno, strerror(errno)); return NULL; } /* accessing file details */ if (fstat(fd, &secret_stats) < 0) { - skygw_log_write(NULL, LOGFILE_ERROR, "secrets_readKeys, failed accessing secret file details [%s]. Error %i, %s\n", secret_file, errno, strerror(errno)); + skygw_log_write( LOGFILE_ERROR, "secrets_readKeys, failed accessing secret file details [%s]. Error %i, %s\n", secret_file, errno, strerror(errno)); return NULL; } if (secret_stats.st_size != sizeof(MAXKEYS)) { - skygw_log_write(NULL, LOGFILE_ERROR, "Secrets file %s is incorrect size\n", secret_file); + skygw_log_write( LOGFILE_ERROR, "Secrets file %s is incorrect size\n", secret_file); return NULL; } if (secret_stats.st_mode != (S_IRUSR|S_IFREG)) { - skygw_log_write(NULL, LOGFILE_ERROR, "Ignoring secrets file, permissions must be read only fo rthe owner\n"); + skygw_log_write( LOGFILE_ERROR, "Ignoring secrets file, permissions must be read only fo rthe owner\n"); return NULL; } if ((keys = (MAXKEYS *)malloc(sizeof(MAXKEYS))) == NULL) { - skygw_log_write(NULL, LOGFILE_ERROR, + skygw_log_write( LOGFILE_ERROR, "Insufficient memory to create the keys structure.\n"); return NULL; } @@ -102,13 +102,13 @@ int fd; /* read all data from file */ if (read(fd, keys, sizeof(MAXKEYS)) != sizeof(MAXKEYS)) { - skygw_log_write(NULL, LOGFILE_ERROR, "secrets_readKeys, failed reading from secret file [%s]. Error %i, %s\n", secret_file, errno, strerror(errno)); + skygw_log_write( LOGFILE_ERROR, "secrets_readKeys, failed reading from secret file [%s]. Error %i, %s\n", secret_file, errno, strerror(errno)); return NULL; } /* Close the file */ if (close(fd) < 0) { - skygw_log_write(NULL, LOGFILE_ERROR, "secrets_readKeys, failed closing the secret file [%s]. Error %i, %s\n", secret_file, errno, strerror(errno)); + skygw_log_write( LOGFILE_ERROR, "secrets_readKeys, failed closing the secret file [%s]. Error %i, %s\n", secret_file, errno, strerror(errno)); return NULL; } @@ -132,7 +132,7 @@ MAXKEYS key; /* Open for writing | Create | Truncate the file for writing */ if ((fd = open(secret_file, O_CREAT | O_WRONLY | O_TRUNC), S_IRUSR) < 0) { - skygw_log_write(NULL, LOGFILE_ERROR, "secrets_createKeys, failed opening secret file [%s]. Error %i, %s\n", secret_file, errno, strerror(errno)); + skygw_log_write( LOGFILE_ERROR, "secrets_createKeys, failed opening secret file [%s]. Error %i, %s\n", secret_file, errno, strerror(errno)); return 1; } @@ -143,14 +143,14 @@ MAXKEYS key; /* Write data */ if (write(fd, &key, sizeof(key)) < 0) { - skygw_log_write(NULL, LOGFILE_ERROR, "secrets_createKeys, failed writing into secret file [%s]. Error %i, %s\n", secret_file, errno, strerror(errno)); + skygw_log_write( LOGFILE_ERROR, "secrets_createKeys, failed writing into secret file [%s]. Error %i, %s\n", secret_file, errno, strerror(errno)); return 1; } /* close file */ if (close(fd) < 0) { - skygw_log_write(NULL, LOGFILE_ERROR, "secrets_createKeys, failed closing the secret file [%s]. Error %i, %s\n", secret_file, errno, strerror(errno)); + skygw_log_write( LOGFILE_ERROR, "secrets_createKeys, failed closing the secret file [%s]. Error %i, %s\n", secret_file, errno, strerror(errno)); } chmod(secret_file, S_IRUSR); diff --git a/server/core/server.c b/server/core/server.c index 30c51411a..2d7b3cf1f 100644 --- a/server/core/server.c +++ b/server/core/server.c @@ -302,19 +302,27 @@ server_update(SERVER *server, char *protocol, char *user, char *passwd) { if (!strcmp(server->protocol, protocol)) { - skygw_log_write(NULL, LOGFILE_MESSAGE, "Update server protocol for server %s to protocol %s", - server->name, protocol); + skygw_log_write( + LOGFILE_MESSAGE, + "Update server protocol for server %s to protocol %s", + server->name, + protocol); free(server->protocol); server->protocol = strdup(protocol); } - if (strcmp(server->monuser, user) == 0 || strcmp(server->monpw, passwd) == 0) - { - skygw_log_write(NULL, LOGFILE_MESSAGE, "Update server monitor credentials for server %s", + if (user != NULL && passwd != NULL) { + if (strcmp(server->monuser, user) == 0 || + strcmp(server->monpw, passwd) == 0) + { + skygw_log_write( + LOGFILE_MESSAGE, + "Update server monitor credentials for server %s", server->name); free(server->monuser); free(server->monpw); serverAddMonUser(server, user, passwd); + } } } diff --git a/server/core/service.c b/server/core/service.c index 530992cd4..9953acdb2 100644 --- a/server/core/service.c +++ b/server/core/service.c @@ -112,7 +112,7 @@ GWPROTOCOL *funcs; loaded = load_mysql_users(service); - skygw_log_write(NULL, LOGFILE_MESSAGE, "MySQL Users loaded: %i\n", loaded); + skygw_log_write( LOGFILE_MESSAGE, "MySQL Users loaded: %i\n", loaded); } if ((funcs = (GWPROTOCOL *)load_module(port->protocol, MODULE_PROTOCOL)) == NULL) @@ -605,12 +605,12 @@ void *router_obj; { if ((router_obj = load_module(router, MODULE_ROUTER)) == NULL) { - skygw_log_write(NULL, LOGFILE_ERROR, "Failed to update router for service %s to %s", + skygw_log_write( LOGFILE_ERROR, "Failed to update router for service %s to %s", service->name, router); } else { - skygw_log_write(NULL, LOGFILE_MESSAGE, "Update router for service %s to %s", + skygw_log_write( LOGFILE_MESSAGE, "Update router for service %s to %s", service->name, router); free(service->routerModule); service->routerModule = strdup(router); @@ -619,7 +619,7 @@ void *router_obj; } if (user && (strcmp(service->credentials.name, user) != 0 || strcmp(service->credentials.authdata, auth) != 0)) { - skygw_log_write(NULL, LOGFILE_MESSAGE, "Update credentials for service %s", service->name); + skygw_log_write( LOGFILE_MESSAGE, "Update credentials for service %s", service->name); serviceSetUser(service, user, auth); } } diff --git a/server/core/users.c b/server/core/users.c index a836f6ad2..63b8a3f6c 100644 --- a/server/core/users.c +++ b/server/core/users.c @@ -113,6 +113,10 @@ users_delete(USERS *users, char *user) int del; atomic_add(&users->stats.n_deletes, 1); + if (users->stats.n_entries == 1) { + atomic_add(&users->stats.n_entries, del * -1); + return 0; + } del = hashtable_delete(users->data, user); atomic_add(&users->stats.n_entries, del * -1); return del; diff --git a/server/core/utils.c b/server/core/utils.c index 982528427..9e7b3d633 100644 --- a/server/core/utils.c +++ b/server/core/utils.c @@ -62,12 +62,12 @@ int setnonblocking(int fd) { int fl; if ((fl = fcntl(fd, F_GETFL, 0)) == -1) { - skygw_log_write(NULL, LOGFILE_ERROR, "Can't GET fcntl for %i, errno = %d, %s", fd, errno, strerror(errno)); + skygw_log_write( LOGFILE_ERROR, "Can't GET fcntl for %i, errno = %d, %s", fd, errno, strerror(errno)); return 1; } if (fcntl(fd, F_SETFL, fl | O_NONBLOCK) == -1) { - skygw_log_write(NULL, LOGFILE_ERROR, "Can't SET fcntl for %i, errno = %d, %s", fd, errno, strerror(errno)); + skygw_log_write( LOGFILE_ERROR, "Can't SET fcntl for %i, errno = %d, %s", fd, errno, strerror(errno)); return 1; } diff --git a/server/include/adminusers.h b/server/include/adminusers.h index 16c61c26d..d46570e38 100644 --- a/server/include/adminusers.h +++ b/server/include/adminusers.h @@ -33,8 +33,10 @@ extern int admin_verify(char *, char *); extern char *admin_add_user(char *, char *); -extern int admin_test_user(char *); +extern int admin_search_user(char *); extern void dcb_PrintAdminUsers(DCB *dcb); +char* admin_remove_user(char* uname, char* passwd); + #endif diff --git a/server/modules/monitor/depend.mk b/server/modules/monitor/depend.mk deleted file mode 100644 index 362a8edd6..000000000 --- a/server/modules/monitor/depend.mk +++ /dev/null @@ -1,44 +0,0 @@ -mysql_mon.o: mysql_mon.c /usr/include/stdio.h /usr/include/features.h \ - /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ - /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/bits/waitflags.h \ - /usr/include/bits/waitstatus.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ - /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h \ - /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ - /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h ../../include/monitor.h \ - ../../include/server.h ../../include/dcb.h ../../include/spinlock.h \ - ../../include/thread.h /usr/include/pthread.h /usr/include/sched.h \ - /usr/include/bits/sched.h /usr/include/bits/setjmp.h \ - ../../include/buffer.h ../../include/gwbitmask.h mysqlmon.h \ - /home/skysql/mariadb-5.5.32/include/mysql.h \ - /home/skysql/mariadb-5.5.32/include/mysql_version.h \ - /home/skysql/mariadb-5.5.32/include/mysql_com.h \ - /home/skysql/mariadb-5.5.32/include/mysql_time.h \ - /home/skysql/mariadb-5.5.32/include/my_list.h \ - /home/skysql/mariadb-5.5.32/include/typelib.h \ - /home/skysql/mariadb-5.5.32/include/my_alloc.h \ - /home/skysql/mariadb-5.5.32/include/mysqld_error.h \ - /home/skysql/workspace/utils/skygw_utils.h \ - /home/skysql/workspace/utils/skygw_types.h /usr/include/math.h \ - /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ - /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ - /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ - /usr/include/bits/mathcalls.h /home/skysql/workspace/utils/skygw_debug.h \ - /usr/include/assert.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ - /usr/include/bits/confname.h /usr/include/getopt.h \ - /home/skysql/workspace/log_manager/log_manager.h ../../include/secrets.h \ - /usr/include/sys/stat.h /usr/include/bits/stat.h /usr/include/fcntl.h \ - /usr/include/bits/fcntl.h /usr/include/errno.h /usr/include/bits/errno.h \ - /usr/include/linux/errno.h /usr/include/asm/errno.h \ - /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ - /usr/include/openssl/aes.h /usr/include/openssl/opensslconf.h \ - /usr/include/openssl/opensslconf-x86_64.h diff --git a/server/modules/monitor/galera_mon.c b/server/modules/monitor/galera_mon.c index a996a3064..f3e6cba1e 100644 --- a/server/modules/monitor/galera_mon.c +++ b/server/modules/monitor/galera_mon.c @@ -72,7 +72,7 @@ version() void ModuleInit() { - skygw_log_write(NULL, LOGFILE_MESSAGE, "Initialise the MySQL Galera Monitor module %s.\n", + skygw_log_write( LOGFILE_MESSAGE, "Initialise the MySQL Galera Monitor module %s.\n", version_str); } @@ -334,8 +334,7 @@ MONITOR_SERVERS *ptr; if (mysql_thread_init()) { - skygw_log_write_flush(NULL, - LOGFILE_ERROR, + skygw_log_write_flush(LOGFILE_ERROR, "Fatal : mysql_init_thread failed in monitor " "module. Exiting.\n"); return; diff --git a/server/modules/monitor/mysql_mon.c b/server/modules/monitor/mysql_mon.c index 313e7e5a2..4d2a154a1 100644 --- a/server/modules/monitor/mysql_mon.c +++ b/server/modules/monitor/mysql_mon.c @@ -76,7 +76,7 @@ version() void ModuleInit() { - skygw_log_write(NULL, LOGFILE_MESSAGE, "Initialise the MySQL Monitor module %s.\n", + skygw_log_write( LOGFILE_MESSAGE, "Initialise the MySQL Monitor module %s.\n", version_str); } @@ -372,8 +372,7 @@ MONITOR_SERVERS *ptr; if (mysql_thread_init()) { - skygw_log_write_flush(NULL, - LOGFILE_ERROR, + skygw_log_write_flush(LOGFILE_ERROR, "Fatal : mysql_init_thread failed in monitor " "module. Exiting.\n"); return; diff --git a/server/modules/protocol/depend.mk b/server/modules/protocol/depend.mk deleted file mode 100644 index e85c9a298..000000000 --- a/server/modules/protocol/depend.mk +++ /dev/null @@ -1,274 +0,0 @@ -mysql_client.o: mysql_client.c ../include/mysql_client_server_protocol.h \ - /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ - /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/bits/waitflags.h \ - /usr/include/bits/waitstatus.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ - /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h \ - /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ - /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/stdint.h /usr/include/bits/wchar.h /usr/include/string.h \ - /usr/include/xlocale.h /usr/include/openssl/sha.h \ - /usr/include/openssl/e_os2.h /usr/include/openssl/opensslconf.h \ - /usr/include/openssl/opensslconf-x86_64.h /usr/include/sys/ioctl.h \ - /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ - /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ - /usr/include/asm/ioctl.h /usr/include/asm-generic/ioctl.h \ - /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \ - /usr/include/errno.h /usr/include/bits/errno.h \ - /usr/include/linux/errno.h /usr/include/asm/errno.h \ - /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ - /usr/include/sys/socket.h /usr/include/sys/uio.h /usr/include/bits/uio.h \ - /usr/include/bits/socket.h /usr/include/bits/sockaddr.h \ - /usr/include/asm/socket.h /usr/include/asm-generic/socket.h \ - /usr/include/asm/sockios.h /usr/include/asm-generic/sockios.h \ - /usr/include/netinet/in.h /usr/include/bits/in.h \ - /usr/include/arpa/inet.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdbool.h \ - /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/bits/stat.h \ - /usr/include/unistd.h /usr/include/bits/posix_opt.h \ - /usr/include/bits/environments.h /usr/include/bits/confname.h \ - /usr/include/getopt.h ../../include/service.h ../../include/spinlock.h \ - ../../include/thread.h /usr/include/pthread.h /usr/include/sched.h \ - /usr/include/bits/sched.h /usr/include/bits/setjmp.h ../../include/dcb.h \ - ../../include/buffer.h ../../include/gwbitmask.h ../../include/server.h \ - ../../include/router.h ../../include/session.h ../../include/poll.h \ - ../../include/users.h ../../include/hashtable.h ../../include/atomic.h -mysql_common.o: mysql_common.c ../include/mysql_client_server_protocol.h \ - /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ - /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/bits/waitflags.h \ - /usr/include/bits/waitstatus.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ - /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h \ - /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ - /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/stdint.h /usr/include/bits/wchar.h /usr/include/string.h \ - /usr/include/xlocale.h /usr/include/openssl/sha.h \ - /usr/include/openssl/e_os2.h /usr/include/openssl/opensslconf.h \ - /usr/include/openssl/opensslconf-x86_64.h /usr/include/sys/ioctl.h \ - /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ - /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ - /usr/include/asm/ioctl.h /usr/include/asm-generic/ioctl.h \ - /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \ - /usr/include/errno.h /usr/include/bits/errno.h \ - /usr/include/linux/errno.h /usr/include/asm/errno.h \ - /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ - /usr/include/sys/socket.h /usr/include/sys/uio.h /usr/include/bits/uio.h \ - /usr/include/bits/socket.h /usr/include/bits/sockaddr.h \ - /usr/include/asm/socket.h /usr/include/asm-generic/socket.h \ - /usr/include/asm/sockios.h /usr/include/asm-generic/sockios.h \ - /usr/include/netinet/in.h /usr/include/bits/in.h \ - /usr/include/arpa/inet.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdbool.h \ - /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/bits/stat.h \ - /usr/include/unistd.h /usr/include/bits/posix_opt.h \ - /usr/include/bits/environments.h /usr/include/bits/confname.h \ - /usr/include/getopt.h ../../include/service.h ../../include/spinlock.h \ - ../../include/thread.h /usr/include/pthread.h /usr/include/sched.h \ - /usr/include/bits/sched.h /usr/include/bits/setjmp.h ../../include/dcb.h \ - ../../include/buffer.h ../../include/gwbitmask.h ../../include/server.h \ - ../../include/router.h ../../include/session.h ../../include/poll.h \ - ../../include/users.h ../../include/hashtable.h ../../include/atomic.h -mysql_backend.o: mysql_backend.c \ - ../include/mysql_client_server_protocol.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ - /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/bits/waitflags.h \ - /usr/include/bits/waitstatus.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ - /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h \ - /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ - /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/stdint.h /usr/include/bits/wchar.h /usr/include/string.h \ - /usr/include/xlocale.h /usr/include/openssl/sha.h \ - /usr/include/openssl/e_os2.h /usr/include/openssl/opensslconf.h \ - /usr/include/openssl/opensslconf-x86_64.h /usr/include/sys/ioctl.h \ - /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ - /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ - /usr/include/asm/ioctl.h /usr/include/asm-generic/ioctl.h \ - /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \ - /usr/include/errno.h /usr/include/bits/errno.h \ - /usr/include/linux/errno.h /usr/include/asm/errno.h \ - /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ - /usr/include/sys/socket.h /usr/include/sys/uio.h /usr/include/bits/uio.h \ - /usr/include/bits/socket.h /usr/include/bits/sockaddr.h \ - /usr/include/asm/socket.h /usr/include/asm-generic/socket.h \ - /usr/include/asm/sockios.h /usr/include/asm-generic/sockios.h \ - /usr/include/netinet/in.h /usr/include/bits/in.h \ - /usr/include/arpa/inet.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdbool.h \ - /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/bits/stat.h \ - /usr/include/unistd.h /usr/include/bits/posix_opt.h \ - /usr/include/bits/environments.h /usr/include/bits/confname.h \ - /usr/include/getopt.h ../../include/service.h ../../include/spinlock.h \ - ../../include/thread.h /usr/include/pthread.h /usr/include/sched.h \ - /usr/include/bits/sched.h /usr/include/bits/setjmp.h ../../include/dcb.h \ - ../../include/buffer.h ../../include/gwbitmask.h ../../include/server.h \ - ../../include/router.h ../../include/session.h ../../include/poll.h \ - ../../include/users.h ../../include/hashtable.h ../../include/atomic.h -mysql_common.o: mysql_common.c ../include/mysql_client_server_protocol.h \ - /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ - /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/bits/waitflags.h \ - /usr/include/bits/waitstatus.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ - /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h \ - /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ - /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/stdint.h /usr/include/bits/wchar.h /usr/include/string.h \ - /usr/include/xlocale.h /usr/include/openssl/sha.h \ - /usr/include/openssl/e_os2.h /usr/include/openssl/opensslconf.h \ - /usr/include/openssl/opensslconf-x86_64.h /usr/include/sys/ioctl.h \ - /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ - /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ - /usr/include/asm/ioctl.h /usr/include/asm-generic/ioctl.h \ - /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \ - /usr/include/errno.h /usr/include/bits/errno.h \ - /usr/include/linux/errno.h /usr/include/asm/errno.h \ - /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ - /usr/include/sys/socket.h /usr/include/sys/uio.h /usr/include/bits/uio.h \ - /usr/include/bits/socket.h /usr/include/bits/sockaddr.h \ - /usr/include/asm/socket.h /usr/include/asm-generic/socket.h \ - /usr/include/asm/sockios.h /usr/include/asm-generic/sockios.h \ - /usr/include/netinet/in.h /usr/include/bits/in.h \ - /usr/include/arpa/inet.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdbool.h \ - /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/bits/stat.h \ - /usr/include/unistd.h /usr/include/bits/posix_opt.h \ - /usr/include/bits/environments.h /usr/include/bits/confname.h \ - /usr/include/getopt.h ../../include/service.h ../../include/spinlock.h \ - ../../include/thread.h /usr/include/pthread.h /usr/include/sched.h \ - /usr/include/bits/sched.h /usr/include/bits/setjmp.h ../../include/dcb.h \ - ../../include/buffer.h ../../include/gwbitmask.h ../../include/server.h \ - ../../include/router.h ../../include/session.h ../../include/poll.h \ - ../../include/users.h ../../include/hashtable.h ../../include/atomic.h -telnetd.o: telnetd.c /usr/include/stdio.h /usr/include/features.h \ - /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ - /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/bits/waitflags.h \ - /usr/include/bits/waitstatus.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ - /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h \ - /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ - /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/unistd.h /usr/include/bits/posix_opt.h \ - /usr/include/bits/environments.h /usr/include/bits/confname.h \ - /usr/include/getopt.h /usr/include/string.h /usr/include/xlocale.h \ - ../../include/dcb.h ../../include/spinlock.h ../../include/thread.h \ - /usr/include/pthread.h /usr/include/sched.h /usr/include/bits/sched.h \ - /usr/include/bits/setjmp.h ../../include/buffer.h \ - ../../include/gwbitmask.h ../../include/service.h ../../include/server.h \ - ../../include/session.h /usr/include/sys/ioctl.h \ - /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ - /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ - /usr/include/asm/ioctl.h /usr/include/asm-generic/ioctl.h \ - /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \ - /usr/include/errno.h /usr/include/bits/errno.h \ - /usr/include/linux/errno.h /usr/include/asm/errno.h \ - /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ - /usr/include/sys/socket.h /usr/include/sys/uio.h /usr/include/bits/uio.h \ - /usr/include/bits/socket.h /usr/include/bits/sockaddr.h \ - /usr/include/asm/socket.h /usr/include/asm-generic/socket.h \ - /usr/include/asm/sockios.h /usr/include/asm-generic/sockios.h \ - /usr/include/netinet/in.h /usr/include/stdint.h \ - /usr/include/bits/wchar.h /usr/include/bits/in.h \ - /usr/include/arpa/inet.h ../../include/router.h ../../include/poll.h \ - ../../include/atomic.h ../../include/gw.h /usr/include/ctype.h \ - /usr/include/netdb.h /usr/include/rpc/netdb.h /usr/include/bits/netdb.h \ - /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/bits/stat.h \ - /usr/include/syslog.h /usr/include/sys/syslog.h \ - /usr/include/bits/syslog-path.h /usr/include/pwd.h \ - /usr/include/sys/epoll.h /usr/include/signal.h \ - /usr/include/bits/signum.h /usr/include/bits/siginfo.h \ - /usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \ - /usr/include/bits/sigstack.h /usr/include/sys/ucontext.h \ - /usr/include/bits/sigthread.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdbool.h \ - ../../include/gateway_mysql.h ../../include/mysql_protocol.h \ - ../../include/dcb.h ../include/telnetd.h ../../include/adminusers.h -httpd.o: httpd.c ../include/httpd.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ - /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/bits/waitflags.h \ - /usr/include/bits/waitstatus.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ - /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h \ - /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ - /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h ../../include/dcb.h \ - ../../include/spinlock.h ../../include/thread.h /usr/include/pthread.h \ - /usr/include/sched.h /usr/include/bits/sched.h \ - /usr/include/bits/setjmp.h ../../include/buffer.h \ - ../../include/gwbitmask.h ../../include/service.h ../../include/server.h \ - ../../include/session.h /usr/include/sys/ioctl.h \ - /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ - /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ - /usr/include/asm/ioctl.h /usr/include/asm-generic/ioctl.h \ - /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \ - /usr/include/errno.h /usr/include/bits/errno.h \ - /usr/include/linux/errno.h /usr/include/asm/errno.h \ - /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ - /usr/include/sys/socket.h /usr/include/sys/uio.h /usr/include/bits/uio.h \ - /usr/include/bits/socket.h /usr/include/bits/sockaddr.h \ - /usr/include/asm/socket.h /usr/include/asm-generic/socket.h \ - /usr/include/asm/sockios.h /usr/include/asm-generic/sockios.h \ - /usr/include/netinet/in.h /usr/include/stdint.h \ - /usr/include/bits/wchar.h /usr/include/bits/in.h \ - /usr/include/arpa/inet.h ../../include/router.h ../../include/poll.h \ - ../../include/atomic.h ../../include/gw.h /usr/include/ctype.h \ - /usr/include/netdb.h /usr/include/rpc/netdb.h /usr/include/bits/netdb.h \ - /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/bits/stat.h \ - /usr/include/unistd.h /usr/include/bits/posix_opt.h \ - /usr/include/bits/environments.h /usr/include/bits/confname.h \ - /usr/include/getopt.h /usr/include/syslog.h /usr/include/sys/syslog.h \ - /usr/include/bits/syslog-path.h /usr/include/pwd.h \ - /usr/include/sys/epoll.h /usr/include/signal.h \ - /usr/include/bits/signum.h /usr/include/bits/siginfo.h \ - /usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \ - /usr/include/bits/sigstack.h /usr/include/sys/ucontext.h \ - /usr/include/bits/sigthread.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdbool.h \ - ../../include/gateway_mysql.h ../../include/mysql_protocol.h \ - ../../include/dcb.h diff --git a/server/modules/protocol/mysql_backend.c b/server/modules/protocol/mysql_backend.c index 886592c73..e84b9c304 100644 --- a/server/modules/protocol/mysql_backend.c +++ b/server/modules/protocol/mysql_backend.c @@ -91,7 +91,7 @@ void ModuleInit() { #if defined(SS_DEBUG) - skygw_log_write(NULL, + skygw_log_write( LOGFILE_MESSAGE, strdup("Initial MySQL Backend Protcol module.")); #endif diff --git a/server/modules/protocol/mysql_client.c b/server/modules/protocol/mysql_client.c index 195a72275..db44ff8ca 100644 --- a/server/modules/protocol/mysql_client.c +++ b/server/modules/protocol/mysql_client.c @@ -81,7 +81,7 @@ version() void ModuleInit() { - fprintf(stderr, "Initial MySQL Client Protcol module.\n"); + fprintf(stderr, "Initialise MySQL Client Protocol module.\n"); } /** @@ -396,7 +396,7 @@ static int gw_mysql_do_authentication(DCB *dcb, GWBUF *queue) { free(auth_token); if (auth_ret != 0) { - fprintf(stderr, "<<< CLIENT AUTH FAILEDi for user [%s]\n", username); + fprintf(stderr, "<<< CLIENT AUTH FAILED for user [%s]\n", username); } return auth_ret; diff --git a/server/modules/routing/Makefile b/server/modules/routing/Makefile index d42fe3892..c07b7b438 100644 --- a/server/modules/routing/Makefile +++ b/server/modules/routing/Makefile @@ -60,14 +60,14 @@ libdebugcli.so: $(DEBUGCLIOBJ) $(CC) $(LDFLAGS) $(DEBUGCLIOBJ) $(LIBS) -o $@ libreadwritesplit.so: -# (cd readwritesplit; make; cp $@ ..) +# (cd readwritesplit; touch depend.mk ; make; cp $@ ..) .c.o: $(CC) $(CFLAGS) $< -o $@ clean: rm -f $(OBJ) $(MODULES) - (cd readwritesplit; make clean) + (cd readwritesplit; touch depend.mk; make clean) tags: ctags $(SRCS) $(HDRS) @@ -76,7 +76,7 @@ tags: depend: @rm -f depend.mk cc -M $(CFLAGS) $(SRCS) > depend.mk - (cd readwritesplit; make depend) + (cd readwritesplit; touch depend.mk ; make depend) install: $(MODULES) install -D $(MODULES) $(DEST)/MaxScale/modules diff --git a/server/modules/routing/debugcli.c b/server/modules/routing/debugcli.c index c8fa95699..9f553b0b1 100644 --- a/server/modules/routing/debugcli.c +++ b/server/modules/routing/debugcli.c @@ -78,7 +78,7 @@ version() void ModuleInit() { - skygw_log_write(NULL, LOGFILE_MESSAGE, "Initialise debug CLI router module %s.\n", version_str); + skygw_log_write( LOGFILE_MESSAGE, "Initialise debug CLI router module %s.\n", version_str); spinlock_init(&instlock); instances = NULL; } diff --git a/server/modules/routing/debugcmd.c b/server/modules/routing/debugcmd.c index f1ebba0bb..cee02a32d 100644 --- a/server/modules/routing/debugcmd.c +++ b/server/modules/routing/debugcmd.c @@ -81,7 +81,7 @@ static void telnetdShowUsers(DCB *); * The subcommands of the show command */ struct subcommand showoptions[] = { - { "dcbs", 0, dprintAllDCBs, "Show all descriptor control blocks (network connections)", + { "dcbs", 0, dprintAllDCBs, "Show all descriptor control blocks (network connections)", {0, 0, 0} }, { "dcb", 1, dprintDCB, "Show a single descriptor control block e.g. show dcb 0x493340", {ARG_TYPE_ADDRESS, 0, 0} }, @@ -117,8 +117,6 @@ static void shutdown_monitor(DCB *dcb, MONITOR *monitor); * The subcommands of the shutdown command */ struct subcommand shutdownoptions[] = { - { "gateway", 0, shutdown_gateway, "Shutdown MaxScale", - {0, 0, 0} }, { "maxscale", 0, shutdown_gateway, "Shutdown the MaxScale gateway", {0, 0, 0} }, { "monitor", 1, shutdown_monitor, "Shutdown a monitor, e.g. shutdown monitor 0x48381e0", @@ -165,7 +163,7 @@ struct subcommand clearoptions[] = { {0, 0, 0} } }; -static void reload_users(DCB *dcb, SERVICE *service); +static void reload_dbusers(DCB *dcb, SERVICE *service); static void reload_config(DCB *dcb); /** @@ -174,7 +172,7 @@ static void reload_config(DCB *dcb); struct subcommand reloadoptions[] = { { "config", 0, reload_config, "Reload the configuration data for MaxScale.", {ARG_TYPE_ADDRESS, 0, 0} }, - { "users", 1, reload_users, "Reload the user data for a service. E.g. reload users 0x849420", + { "dbusers", 1, reload_dbusers, "Reload the dbuser data for a service. E.g. reload dbusers 0x849420", {ARG_TYPE_ADDRESS, 0, 0} }, { NULL, 0, NULL, NULL, {0, 0, 0} } @@ -191,6 +189,25 @@ struct subcommand addoptions[] = { {0, 0, 0} } }; + +static void telnetdRemoveUser(DCB *, char *, char *); +/** + * The subcommands of the remove command + */ +struct subcommand removeoptions[] = { + { + "user", + 2, + telnetdRemoveUser, + "Remove existing maxscale user. Example : remove user john johnpwd", + {ARG_TYPE_STRING, ARG_TYPE_STRING, 0} + }, + { + NULL, 0, NULL, NULL, {0, 0, 0} + } +}; + + /** * The debug command table */ @@ -200,6 +217,7 @@ static struct { } cmds[] = { { "add", addoptions }, { "clear", clearoptions }, + { "remove", removeoptions }, { "restart", restartoptions }, { "set", setoptions }, { "show", showoptions }, @@ -494,7 +512,7 @@ unsigned int bitvalue; * @param service The service to update */ static void -reload_users(DCB *dcb, SERVICE *service) +reload_dbusers(DCB *dcb, SERVICE *service) { dcb_printf(dcb, "Loaded %d database users for server %s.\n", reload_mysql_users(service), service->name); @@ -513,7 +531,7 @@ reload_config(DCB *dcb) } /** - * Add a new admin user + * Add a new maxscale admin user * * @param dcb The DCB for messages * @param user The user name @@ -524,7 +542,7 @@ telnetdAddUser(DCB *dcb, char *user, char *passwd) { char *err; - if (admin_test_user(user)) + if (admin_search_user(user)) { dcb_printf(dcb, "User %s already exists.\n", user); return; @@ -535,6 +553,39 @@ char *err; dcb_printf(dcb, "Failed to add new user. %s\n", err); } + +/** + * Remove a maxscale admin user + * + * @param dcb The DCB for messages + * @param user The user name + * @param passwd The Password of the user + */ +static void telnetdRemoveUser( + DCB* dcb, + char* user, + char* passwd) +{ + char* err; + + if (!admin_search_user(user)) + { + dcb_printf(dcb, "User %s doesn't exist.\n", user); + return; + } + + if ((err = admin_remove_user(user, passwd)) == NULL) + { + dcb_printf(dcb, "User %s has been successfully removed.\n", user); + } + else + { + dcb_printf(dcb, "Failed to remove user %s. %s\n", user, err); + } +} + + + /** * Print the adminsitration users * diff --git a/server/modules/routing/depend.mk b/server/modules/routing/depend.mk deleted file mode 100644 index 85c4d7793..000000000 --- a/server/modules/routing/depend.mk +++ /dev/null @@ -1,125 +0,0 @@ -testroute.o: testroute.c /usr/include/stdio.h /usr/include/features.h \ - /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ - /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - ../../include/router.h ../../include/service.h /usr/include/time.h \ - /usr/include/bits/time.h /usr/include/xlocale.h ../../include/spinlock.h \ - ../../include/thread.h /usr/include/pthread.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ - /usr/include/sched.h /usr/include/bits/sched.h \ - /usr/include/bits/pthreadtypes.h /usr/include/bits/setjmp.h \ - ../../include/dcb.h ../../include/buffer.h ../../include/gwbitmask.h \ - ../../include/server.h ../../include/session.h -readconnroute.o: readconnroute.c /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ - /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/bits/waitflags.h \ - /usr/include/bits/waitstatus.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ - /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h \ - /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ - /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h ../../include/service.h \ - ../../include/spinlock.h ../../include/thread.h /usr/include/pthread.h \ - /usr/include/sched.h /usr/include/bits/sched.h \ - /usr/include/bits/setjmp.h ../../include/dcb.h ../../include/buffer.h \ - ../../include/gwbitmask.h ../../include/server.h ../../include/router.h \ - ../../include/session.h ../../include/atomic.h \ - ../include/readconnection.h /home/skysql/workspace/utils/skygw_types.h \ - /usr/include/math.h /usr/include/bits/huge_val.h \ - /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ - /usr/include/bits/inf.h /usr/include/bits/nan.h \ - /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ - /home/skysql/workspace/utils/skygw_utils.h \ - /home/skysql/workspace/utils/skygw_types.h \ - /home/skysql/workspace/utils/skygw_debug.h /usr/include/assert.h \ - /usr/include/unistd.h /usr/include/bits/posix_opt.h \ - /usr/include/bits/environments.h /usr/include/bits/confname.h \ - /usr/include/getopt.h /home/skysql/workspace/log_manager/log_manager.h \ - ../include/mysql_client_server_protocol.h /usr/include/stdint.h \ - /usr/include/bits/wchar.h /usr/include/openssl/sha.h \ - /usr/include/openssl/e_os2.h /usr/include/openssl/opensslconf.h \ - /usr/include/openssl/opensslconf-x86_64.h /usr/include/sys/ioctl.h \ - /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ - /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ - /usr/include/asm/ioctl.h /usr/include/asm-generic/ioctl.h \ - /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \ - /usr/include/errno.h /usr/include/bits/errno.h \ - /usr/include/linux/errno.h /usr/include/asm/errno.h \ - /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ - /usr/include/sys/socket.h /usr/include/sys/uio.h /usr/include/bits/uio.h \ - /usr/include/bits/socket.h /usr/include/bits/sockaddr.h \ - /usr/include/asm/socket.h /usr/include/asm-generic/socket.h \ - /usr/include/asm/sockios.h /usr/include/asm-generic/sockios.h \ - /usr/include/netinet/in.h /usr/include/bits/in.h \ - /usr/include/arpa/inet.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdbool.h \ - /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/bits/stat.h \ - ../../include/poll.h ../../include/users.h ../../include/hashtable.h -debugcli.o: debugcli.c /usr/include/stdio.h /usr/include/features.h \ - /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ - /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/bits/waitflags.h \ - /usr/include/bits/waitstatus.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ - /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h \ - /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ - /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h ../../include/service.h \ - ../../include/spinlock.h ../../include/thread.h /usr/include/pthread.h \ - /usr/include/sched.h /usr/include/bits/sched.h \ - /usr/include/bits/setjmp.h ../../include/dcb.h ../../include/buffer.h \ - ../../include/gwbitmask.h ../../include/server.h ../../include/session.h \ - ../../include/router.h ../../include/modules.h ../../include/atomic.h \ - ../../include/poll.h ../include/debugcli.h \ - /home/skysql/workspace/utils/skygw_utils.h \ - /home/skysql/workspace/utils/skygw_types.h /usr/include/math.h \ - /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ - /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ - /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ - /usr/include/bits/mathcalls.h /home/skysql/workspace/utils/skygw_debug.h \ - /usr/include/assert.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ - /usr/include/bits/confname.h /usr/include/getopt.h \ - /home/skysql/workspace/log_manager/log_manager.h -debugcmd.o: debugcmd.c /usr/include/stdio.h /usr/include/features.h \ - /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ - /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/bits/waitflags.h \ - /usr/include/bits/waitstatus.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ - /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h \ - /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ - /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h ../../include/service.h \ - ../../include/spinlock.h ../../include/thread.h /usr/include/pthread.h \ - /usr/include/sched.h /usr/include/bits/sched.h \ - /usr/include/bits/setjmp.h ../../include/dcb.h ../../include/buffer.h \ - ../../include/gwbitmask.h ../../include/server.h ../../include/session.h \ - ../../include/router.h ../../include/modules.h ../../include/atomic.h \ - ../../include/poll.h ../../include/users.h ../../include/hashtable.h \ - ../../include/dbusers.h ../../include/config.h ../include/telnetd.h \ - ../../include/adminusers.h ../../include/monitor.h ../include/debugcli.h diff --git a/server/modules/routing/readconnroute.c b/server/modules/routing/readconnroute.c index 6128f97e3..155ec7504 100644 --- a/server/modules/routing/readconnroute.c +++ b/server/modules/routing/readconnroute.c @@ -56,8 +56,9 @@ * with macros and MySQL commands with MYSQL_ prefix * avoiding any conflict with the standard ones * in mysql.h - * 22/07/13 Mark Riddoch Addition of joined router option for Galera + * 22/07/2013 Mark Riddoch Addition of joined router option for Galera * clusters + * 31/07/2013 Massimiliano Pinto Added a check for candidate server, if NULL return * * @endverbatim */ @@ -113,7 +114,7 @@ version() void ModuleInit() { - skygw_log_write(NULL, + skygw_log_write( LOGFILE_MESSAGE, "Initialise readconnroute router module %s.\n", version_str); spinlock_init(&instlock); @@ -296,6 +297,12 @@ int i; } } + /* no candidate server here, clean and return NULL */ + if (!candidate) { + free(client); + return NULL; + } + /* * We now have the server with the least connections. * Bump the connection count for this server diff --git a/server/modules/routing/readwritesplit/depend.mk b/server/modules/routing/readwritesplit/depend.mk deleted file mode 100644 index 8e3fa1868..000000000 --- a/server/modules/routing/readwritesplit/depend.mk +++ /dev/null @@ -1,42 +0,0 @@ -readwritesplit.o: readwritesplit.c /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ - /usr/include/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/strings.h /usr/include/xlocale.h /usr/include/string.h \ - ../../../include/router.h ../../../include/service.h /usr/include/time.h \ - /usr/include/bits/time.h ../../../include/spinlock.h \ - ../../../include/thread.h /usr/include/pthread.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ - /usr/include/sched.h /usr/include/bits/sched.h \ - /usr/include/bits/pthreadtypes.h /usr/include/bits/setjmp.h \ - ../../../include/dcb.h ../../../include/buffer.h \ - ../../../include/gwbitmask.h ../../../include/server.h \ - ../../../include/session.h ../../include/readwritesplit.h \ - /usr/include/stdlib.h /usr/include/bits/waitflags.h \ - /usr/include/bits/waitstatus.h /usr/include/sys/types.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \ - /usr/include/alloca.h /home/skysql/mariadb-5.5.32/include/mysql.h \ - /home/skysql/mariadb-5.5.32/include/mysql_version.h \ - /home/skysql/mariadb-5.5.32/include/mysql_com.h \ - /home/skysql/mariadb-5.5.32/include/mysql_time.h \ - /home/skysql/mariadb-5.5.32/include/my_list.h \ - /home/skysql/mariadb-5.5.32/include/typelib.h \ - /home/skysql/mariadb-5.5.32/include/my_alloc.h \ - /home/skysql/workspace/utils/skygw_utils.h \ - /home/skysql/workspace/utils/skygw_types.h /usr/include/math.h \ - /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ - /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ - /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ - /usr/include/bits/mathcalls.h /home/skysql/workspace/utils/skygw_debug.h \ - /usr/include/assert.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ - /usr/include/bits/confname.h /usr/include/getopt.h \ - /home/skysql/workspace/log_manager/log_manager.h \ - /home/skysql/workspace/query_classifier/query_classifier.h \ - /home/skysql/workspace/query_classifier/../utils/skygw_utils.h diff --git a/server/modules/routing/readwritesplit/readwritesplit.c b/server/modules/routing/readwritesplit/readwritesplit.c index 296b5ab1e..b5501a791 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.c +++ b/server/modules/routing/readwritesplit/readwritesplit.c @@ -88,8 +88,7 @@ version() void ModuleInit() { - skygw_log_write_flush(NULL, - LOGFILE_MESSAGE, + skygw_log_write_flush(LOGFILE_MESSAGE, "Initialize read/write split router module.\n"); spinlock_init(&instlock); instances = NULL; @@ -104,8 +103,7 @@ ModuleInit() * @return The module object */ ROUTER_OBJECT* GetModuleObject() { - skygw_log_write(NULL, - LOGFILE_TRACE, + skygw_log_write(LOGFILE_TRACE, "Returning readwritesplit router module object."); return &MyObject; } @@ -206,17 +204,17 @@ static void* newSession( int i; if ((client = (CLIENT_SESSION *)malloc(sizeof(CLIENT_SESSION))) == NULL) - { + { return NULL; } - + /** * Find a backend server to connect to. This is the extent of the * load balancing algorithm we need to implement for this simple * connection router. */ for (i = 0; inst->servers[i]; i++) - { + { if (inst->servers[i] && SERVER_IS_SLAVE(inst->servers[i]->server)) { @@ -226,8 +224,8 @@ static void* newSession( } /** - * Loop over all the servers and find any that have fewer connections than our - * candidate server. + * Loop over all the servers and find any that have fewer connections + * than our candidate server. * * If a server has less connections than the current candidate we mark this * as the new candidate to connect to. @@ -434,7 +432,7 @@ static int routeQuery( "Packet type\t%s", STRPACKETTYPE(packet_type)); #endif - + switch (qtype) { case QUERY_TYPE_WRITE: #if defined(SS_DEBUG_) diff --git a/server/modules/routing/testroute.c b/server/modules/routing/testroute.c index d276ee163..21324ba68 100644 --- a/server/modules/routing/testroute.c +++ b/server/modules/routing/testroute.c @@ -60,7 +60,7 @@ ModuleInit() ROUTER_OBJECT * GetModuleObject() { - fprintf(stderr, "Returing test router module object.\n"); + fprintf(stderr, "Returning test router module object.\n"); return &MyObject; } diff --git a/table_replication_consistency/table_replication_consistency.cpp b/table_replication_consistency/table_replication_consistency.cpp index 2a6dc3c45..baa1a4833 100644 --- a/table_replication_consistency/table_replication_consistency.cpp +++ b/table_replication_consistency/table_replication_consistency.cpp @@ -204,7 +204,7 @@ tb_replication_consistency_init( strcpy(rpl[i].error_message, errmsg.c_str()); // This will log error to log file - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)errmsg.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)errmsg.c_str()); return (1); } @@ -273,7 +273,7 @@ error_handling: tb_consistency[i].error_message = (char *)malloc(errmsg.size()+1); strcpy(tb_consistency[i].error_message, errmsg.c_str()); // This will log error to log file - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)errmsg.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)errmsg.c_str()); err_exit: *n_servers=i-1; @@ -335,7 +335,7 @@ error_handling: rpl->error_message = (char *)malloc(errmsg.size()+1); strcpy(rpl->error_message, errmsg.c_str()); // This will log error to log file - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)errmsg.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)errmsg.c_str()); err_exit: return (1); @@ -420,7 +420,7 @@ error_handling: *error_message = (char *)malloc(errmsg.size()+1); strcpy(*error_message, errmsg.c_str()); // This will log error to log file - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)errmsg.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)errmsg.c_str()); err_exit: return (1); diff --git a/table_replication_consistency/table_replication_listener.cpp b/table_replication_consistency/table_replication_listener.cpp index cb4baf5d2..51cf75779 100644 --- a/table_replication_consistency/table_replication_listener.cpp +++ b/table_replication_consistency/table_replication_listener.cpp @@ -205,7 +205,7 @@ tbrl_update_consistency( if (tbr_trace) { // This will log error to log file - skygw_log_write_flush(NULL, LOGFILE_TRACE, + skygw_log_write_flush( LOGFILE_TRACE, (char *)"TRC Trace: Current state for table %s in server %d binlog_pos %lu GTID '%s'", tc->db_table, tc->server_id, tc->binlog_pos, gtid.get_string().c_str()); } @@ -261,7 +261,7 @@ tbrl_update_server_status( if (tbr_trace) { // This will log error to log file - skygw_log_write_flush(NULL, LOGFILE_TRACE, + skygw_log_write_flush( LOGFILE_TRACE, (char *)"TRC Trace: Current state for server %d binlog_pos %lu GTID '%s'", ts->server_id, ts->binlog_pos, gtid.get_string().c_str()); } @@ -309,7 +309,7 @@ void* tb_replication_listener_reader( if (tbr_trace) { string trace_msg = "Server " + string(uri) + string(server_type); - skygw_log_write_flush(NULL, LOGFILE_TRACE, (char *)trace_msg.c_str()); + skygw_log_write_flush( LOGFILE_TRACE, (char *)trace_msg.c_str()); } Binary_log_event *event; @@ -373,7 +373,7 @@ void* tb_replication_listener_reader( } if (tbr_debug) { - skygw_log_write_flush(NULL, LOGFILE_TRACE, + skygw_log_write_flush( LOGFILE_TRACE, (char *)"TRC Debug: Thread %ld Server %d Binlog_pos %lu event %d" " : %s Query %s DB %s gtid '%s'", id, @@ -405,7 +405,7 @@ void* tb_replication_listener_reader( } if (tbr_debug) { - skygw_log_write_flush(NULL, LOGFILE_TRACE, + skygw_log_write_flush( LOGFILE_TRACE, (char *)"TRC Debug: Thread %ld Server %d Binlog_pos %lu event %d" " : %s gtid '%s'", id, @@ -429,7 +429,7 @@ void* tb_replication_listener_reader( tid2tname[table_map_event->table_id]= database_dot_table; if (tbr_debug) { - skygw_log_write_flush(NULL, LOGFILE_TRACE, + skygw_log_write_flush( LOGFILE_TRACE, (char *)"TRC Debug: Thread %ld Server %d Binlog_pos %lu event %d" " : %s dbtable '%s' id %d", id, @@ -460,7 +460,7 @@ void* tb_replication_listener_reader( } if (tbr_debug) { - skygw_log_write_flush(NULL, LOGFILE_TRACE, + skygw_log_write_flush( LOGFILE_TRACE, (char *)"TRC Debug: Thread %ld Server %d Binlog_pos %lu event %d" " : %s dbtable '%s' id %d", id, @@ -488,14 +488,14 @@ void* tb_replication_listener_reader( catch(ListenerException e) { string err = std::string("Listener exception: ")+ e.what(); - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)err.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)err.c_str()); // Re-Throw this one. throw; } catch(boost::system::error_code e) { string err = std::string("Listener system exception: ")+ e.message(); - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)err.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)err.c_str()); // Re-Throw this one. throw; } @@ -503,7 +503,7 @@ void* tb_replication_listener_reader( catch(std::exception const& e) { string err = std::string("Listener other exception: ")+ e.what(); - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)err.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)err.c_str()); // Re-Throw this one. throw; } @@ -511,7 +511,7 @@ void* tb_replication_listener_reader( catch(...) { string err = std::string("Unknown exception: "); - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)err.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)err.c_str()); // Re-Throw this one. // It was not handled so you want to make sure it is handled correctly by // the OS. So just allow the exception to keep propagating. @@ -520,7 +520,7 @@ void* tb_replication_listener_reader( if (tbr_trace) { string trace_msg = string("Listener for server ") + string(uri) + string(server_type) + string(" shutting down"); - skygw_log_write_flush(NULL, LOGFILE_TRACE, (char *)trace_msg.c_str()); + skygw_log_write_flush( LOGFILE_TRACE, (char *)trace_msg.c_str()); } // Thread execution will end here @@ -551,7 +551,7 @@ tb_replication_listener_shutdown( Binary_log *binlog = (*b_it).second; if (tbr_debug) { - skygw_log_write_flush(NULL, LOGFILE_TRACE, + skygw_log_write_flush( LOGFILE_TRACE, (char *)"TRC Debug: Shutting down replication listener for server %s", binlog->get_url().c_str()); } @@ -562,14 +562,14 @@ tb_replication_listener_shutdown( catch(ListenerException e) { string err = std::string("Listener exception: ")+ e.what(); - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)err.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)err.c_str()); // Re-Throw this one. throw; } catch(boost::system::error_code e) { string err = std::string("Listener system exception: ")+ e.message(); - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)err.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)err.c_str()); // Re-Throw this one. throw; } @@ -577,7 +577,7 @@ tb_replication_listener_shutdown( catch(std::exception const& e) { string err = std::string("Listener other exception: ")+ e.what(); - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)err.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)err.c_str()); // Re-Throw this one. throw; } @@ -585,7 +585,7 @@ tb_replication_listener_shutdown( catch(...) { string err = std::string("Unknown exception: "); - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)err.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)err.c_str()); // Re-Throw this one. // It was not handled so you want to make sure it is handled correctly by // the OS. So just allow the exception to keep propagating. @@ -598,7 +598,7 @@ tb_replication_listener_shutdown( *error_message = (char *)malloc(err.size()+1); strcpy(*error_message, err.c_str()); - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)err.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)err.c_str()); return (1); } @@ -640,7 +640,7 @@ tb_replication_listener_consistency( if (found) { if (tbr_trace) { // This will log error to log file - skygw_log_write_flush(NULL, LOGFILE_TRACE, + skygw_log_write_flush( LOGFILE_TRACE, (char *)"TRC Trace: Current state for table %s in server %d binlog_pos %lu GTID '%s'", tc->db_table, tc->server_id, tc->binlog_pos, tc->gtid); } @@ -683,7 +683,7 @@ tb_replication_listener_reconnect( if (found) { if (tbr_debug) { - skygw_log_write_flush(NULL, LOGFILE_TRACE, + skygw_log_write_flush( LOGFILE_TRACE, (char *)"TRC Debug: Reconnecting to server %s", binlog->get_url().c_str()); } @@ -719,14 +719,14 @@ tb_replication_listener_reconnect( catch(ListenerException e) { string err = std::string("Listener exception: ")+ e.what(); - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)err.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)err.c_str()); // Re-Throw this one. throw; } catch(boost::system::error_code e) { string err = std::string("Listener system exception: ")+ e.message(); - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)err.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)err.c_str()); // Re-Throw this one. throw; } @@ -734,7 +734,7 @@ tb_replication_listener_reconnect( catch(std::exception const& e) { string err = std::string("Listener other exception: ")+ e.what(); - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)err.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)err.c_str()); // Re-Throw this one. throw; } @@ -742,7 +742,7 @@ tb_replication_listener_reconnect( catch(...) { string err = std::string("Unknown exception: "); - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)err.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)err.c_str()); // Re-Throw this one. // It was not handled so you want to make sure it is handled correctly by // the OS. So just allow the exception to keep propagating. @@ -761,7 +761,7 @@ err_exit: if (error_message) { rpl->error_message = (char *)malloc(strlen(error_message +1)); strcpy(rpl->error_message, error_message); - skygw_log_write_flush(NULL, LOGFILE_ERROR, error_message); + skygw_log_write_flush( LOGFILE_ERROR, error_message); } return (1); @@ -802,7 +802,7 @@ void tm = (tbr_metadata_t**)calloc(nelems, sizeof(tbr_metadata_t*)); if (!tm) { - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)"Error: TRM: Out of memory"); + skygw_log_write_flush( LOGFILE_ERROR, (char *)"Error: TRM: Out of memory"); goto my_exit; } @@ -841,7 +841,7 @@ void ts = (tbr_server_t**)calloc(nelems, sizeof(tbr_server_t*)); if (!ts) { - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)"Error: TRM: Out of memory"); + skygw_log_write_flush( LOGFILE_ERROR, (char *)"Error: TRM: Out of memory"); goto my_exit; } @@ -870,27 +870,27 @@ void catch(ListenerException e) { string err = std::string("Listener exception: ")+ e.what(); - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)err.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)err.c_str()); goto my_exit; } catch(boost::system::error_code e) { string err = std::string("Listener system exception: ")+ e.message(); - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)err.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)err.c_str()); goto my_exit; } // Try and catch all exceptions catch(std::exception const& e) { string err = std::string("Listener other exception: ")+ e.what(); - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)err.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)err.c_str()); goto my_exit; } // Rest of them catch(...) { string err = std::string("Unknown exception: "); - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)err.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)err.c_str()); goto my_exit; } } @@ -906,7 +906,7 @@ my_exit: } if (tbr_trace) { - skygw_log_write_flush(NULL, LOGFILE_TRACE, (char *)"Shutting down the metadata updater thread"); + skygw_log_write_flush( LOGFILE_TRACE, (char *)"Shutting down the metadata updater thread"); } pthread_exit(NULL); @@ -974,27 +974,27 @@ tb_replication_listener_init( catch(ListenerException e) { err = std::string("Listener exception: ")+ e.what(); - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)err.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)err.c_str()); goto error_exit; } catch(boost::system::error_code e) { err = std::string("Listener system exception: ")+ e.message(); - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)err.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)err.c_str()); goto error_exit; } // Try and catch all exceptions catch(std::exception const& e) { err = std::string("Listener other exception: ")+ e.what(); - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)err.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)err.c_str()); goto error_exit; } // Rest of them catch(...) { err = std::string("Unknown exception: "); - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)err.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)err.c_str()); goto error_exit; } @@ -1026,7 +1026,7 @@ tb_replication_listener_done( ts = (tbr_server_t **)calloc(nelems2, sizeof(tbr_server_t*)); if (tm == NULL || ts == NULL) { - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)"TRM: Out of memory"); + skygw_log_write_flush( LOGFILE_ERROR, (char *)"TRM: Out of memory"); goto error_exit; } @@ -1094,32 +1094,32 @@ tb_replication_listener_done( catch(ListenerException e) { string err = std::string("Listener exception: ")+ e.what(); - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)err.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)err.c_str()); goto error_exit; } catch(boost::system::error_code e) { string err = std::string("Listener system exception: ")+ e.message(); - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)err.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)err.c_str()); goto error_exit; } // Try and catch all exceptions catch(std::exception const& e) { string err = std::string("Listener other exception: ")+ e.what(); - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)err.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)err.c_str()); goto error_exit; } // Rest of them catch(...) { string err = std::string("Unknown exception: "); - skygw_log_write_flush(NULL, LOGFILE_ERROR, (char *)err.c_str()); + skygw_log_write_flush( LOGFILE_ERROR, (char *)err.c_str()); goto error_exit; } if (tbr_trace) { - skygw_log_write_flush(NULL, LOGFILE_TRACE, (char *)"Shutting down the listeners"); + skygw_log_write_flush( LOGFILE_TRACE, (char *)"Shutting down the listeners"); goto error_exit; } diff --git a/table_replication_consistency/table_replication_metadata.cpp b/table_replication_consistency/table_replication_metadata.cpp index 600f61f42..76b041546 100644 --- a/table_replication_consistency/table_replication_metadata.cpp +++ b/table_replication_consistency/table_replication_metadata.cpp @@ -54,10 +54,10 @@ tbrm_report_error( const char *file, /*!< in: File name */ int line) /*!< in: Line number */ { - skygw_log_write_flush(NULL, LOGFILE_ERROR, + skygw_log_write_flush( LOGFILE_ERROR, (char *)"%s at file %s line %d", message, file, line); if (con != NULL) { - skygw_log_write_flush(NULL, LOGFILE_ERROR, + skygw_log_write_flush( LOGFILE_ERROR, (char *)"%s", mysql_error(con)); mysql_close(con); } @@ -74,12 +74,12 @@ tbrm_stmt_error( const char *file, /*!< in: File name */ int line) /*!< in: Line number */ { - skygw_log_write_flush(NULL, LOGFILE_ERROR, + skygw_log_write_flush( LOGFILE_ERROR, (char *)"%s at file %s line %d", message, file, line); if (stmt != NULL) { - skygw_log_write_flush(NULL, LOGFILE_ERROR, + skygw_log_write_flush( LOGFILE_ERROR, (char *)"Error %u (%s): %s\n", mysql_stmt_errno (stmt), mysql_stmt_sqlstate (stmt), @@ -104,7 +104,7 @@ tbrm_create_metadata( unsigned int myerrno=0; if (!con) { - skygw_log_write_flush(NULL, LOGFILE_ERROR, + skygw_log_write_flush( LOGFILE_ERROR, (char *)"Mysql init failed", mysql_error(con)); return false; } @@ -230,7 +230,7 @@ tbrm_read_consistency_metadata( MYSQL *con = mysql_init(NULL); if (!con) { - skygw_log_write_flush(NULL, LOGFILE_ERROR, + skygw_log_write_flush( LOGFILE_ERROR, (char *)"Error: MySQL init failed"); return false; } @@ -271,7 +271,7 @@ tbrm_read_consistency_metadata( tm = (tbr_metadata_t*) malloc(nrows * sizeof(tbr_metadata_t)); if (!tm) { - skygw_log_write_flush(NULL, LOGFILE_ERROR, + skygw_log_write_flush( LOGFILE_ERROR, (char *)"Error: Out of memory"); goto error_exit; } @@ -287,7 +287,7 @@ tbrm_read_consistency_metadata( tm[i].db_table = (unsigned char *)malloc(lengths[0]); if (!tm[i].db_table) { - skygw_log_write_flush(NULL, LOGFILE_ERROR, + skygw_log_write_flush( LOGFILE_ERROR, (char *)"Error: Out of memory"); goto error_exit; } @@ -300,7 +300,7 @@ tbrm_read_consistency_metadata( if (!tm[i].gtid) { free(tm[i].db_table); - skygw_log_write_flush(NULL, LOGFILE_ERROR, + skygw_log_write_flush( LOGFILE_ERROR, (char *)"Error: Out of memory"); goto error_exit; } @@ -388,7 +388,7 @@ tbrm_write_consistency_metadata( MYSQL *con = mysql_init(NULL); if (!con) { - skygw_log_write_flush(NULL, LOGFILE_ERROR, + skygw_log_write_flush( LOGFILE_ERROR, (char *)"Mysql init failed", mysql_error(con)); return false; } @@ -540,7 +540,7 @@ tbrm_write_consistency_metadata( goto error_exit; } if (tbr_debug) { - skygw_log_write_flush(NULL, LOGFILE_TRACE, + skygw_log_write_flush( LOGFILE_TRACE, (char *)"TRC Debug: Metadata state updated for %s in server %d is binlog_pos %lu gtid '%s'", dbtable, serverid, binlogpos, gtid); } @@ -562,7 +562,7 @@ tbrm_write_consistency_metadata( } if (tbr_debug) { - skygw_log_write_flush(NULL, LOGFILE_TRACE, + skygw_log_write_flush( LOGFILE_TRACE, (char *)"TRC Debug: Metadata state inserted for %s in server %d is binlog_pos %lu gtid '%s'", dbtable, serverid, binlogpos, gtid); } @@ -626,7 +626,7 @@ tbrm_read_server_metadata( MYSQL *con = mysql_init(NULL); if (!con) { - skygw_log_write_flush(NULL, LOGFILE_ERROR, + skygw_log_write_flush( LOGFILE_ERROR, (char *)"Mysql init failed", mysql_error(con)); return false; @@ -668,7 +668,7 @@ tbrm_read_server_metadata( ts = (tbr_server_t*) malloc(nrows * sizeof(tbr_server_t)); if(!ts) { - skygw_log_write_flush(NULL, LOGFILE_ERROR, + skygw_log_write_flush( LOGFILE_ERROR, (char *)"Error: Out of memory"); goto error_exit; } @@ -687,7 +687,7 @@ tbrm_read_server_metadata( ts[i].gtid = (unsigned char *)malloc((lengths[2])*sizeof(unsigned char)); if (!ts[i].gtid) { - skygw_log_write_flush(NULL, LOGFILE_ERROR, + skygw_log_write_flush( LOGFILE_ERROR, (char *)"Error: Out of memory"); goto error_exit; } @@ -774,7 +774,7 @@ tbrm_write_server_metadata( MYSQL *con = mysql_init(NULL); if (!con) { - skygw_log_write_flush(NULL, LOGFILE_ERROR, + skygw_log_write_flush( LOGFILE_ERROR, (char *)"Mysql init failed", mysql_error(con)); return false; } @@ -919,7 +919,7 @@ tbrm_write_server_metadata( goto error_exit; } if (tbr_debug) { - skygw_log_write_flush(NULL, LOGFILE_TRACE, + skygw_log_write_flush( LOGFILE_TRACE, (char *)"TRC Debug: Metadata state updated for %s in server %d is binlog_pos %lu gtid '%s'", dbtable, serverid, binlogpos, gtid); } @@ -941,7 +941,7 @@ tbrm_write_server_metadata( } if (tbr_debug) { - skygw_log_write_flush(NULL, LOGFILE_TRACE, + skygw_log_write_flush( LOGFILE_TRACE, (char *)"TRC Debug: Metadata state inserted for %s in server %d is binlog_pos %lu gtid '%s'", dbtable, serverid, binlogpos, gtid); } diff --git a/table_replication_consistency/table_replication_parser.cpp b/table_replication_consistency/table_replication_parser.cpp index f1372a56f..a14f825df 100644 --- a/table_replication_consistency/table_replication_parser.cpp +++ b/table_replication_consistency/table_replication_parser.cpp @@ -366,7 +366,7 @@ tbr_parser_table_names( name_count++; if (tbr_debug) { - skygw_log_write_flush(NULL, LOGFILE_TRACE, + skygw_log_write_flush( LOGFILE_TRACE, (char *)"TRC Debug: INSERT OR REPLACE to %s.%s", dbname, tbname); } @@ -404,7 +404,7 @@ tbr_parser_table_names( name_count++; if (tbr_debug) { - skygw_log_write_flush(NULL, LOGFILE_TRACE, + skygw_log_write_flush( LOGFILE_TRACE, (char *)"TRC Debug: DELETE OR UPDATE to %s.%s", dbname, tbname); } @@ -433,7 +433,7 @@ tbr_parser_table_names( name_count++; if (tbr_debug) { - skygw_log_write_flush(NULL, LOGFILE_TRACE, + skygw_log_write_flush( LOGFILE_TRACE, (char *)"TRC Debug: LOAD to %s.%s", dbname, tbname); } @@ -480,7 +480,7 @@ tbr_parser_table_names( name_count++; if (tbr_debug) { - skygw_log_write_flush(NULL, LOGFILE_TRACE, + skygw_log_write_flush( LOGFILE_TRACE, (char *)"TRC Debug: DROP TABLE to %s.%s", dbname, tbname); } @@ -490,7 +490,7 @@ tbr_parser_table_names( return (false); } } - skygw_log_write_flush(NULL, LOGFILE_TRACE, + skygw_log_write_flush( LOGFILE_TRACE, (char *)"TRC Debug: CREATE/DROP TABLE to %s.%s", dbname, tbname); } diff --git a/utils/skygw_utils.cc b/utils/skygw_utils.cc index 043cd7a32..3c613b163 100644 --- a/utils/skygw_utils.cc +++ b/utils/skygw_utils.cc @@ -85,6 +85,7 @@ struct skygw_file_st { skygw_chk_t sf_chk_top; char* sf_fname; FILE* sf_file; + int sf_fd; skygw_chk_t sf_chk_tail; }; @@ -1562,6 +1563,7 @@ bool skygw_file_write( bool flush) { bool succp = FALSE; + int err = 0; #if !defined(LAPTOP_TEST) size_t nwritten; int fd; @@ -1587,7 +1589,8 @@ bool skygw_file_write( if (flush || writecount == FSYNCLIMIT) { fd = fileno(file->sf_file); - fsync(fd); + err = fflush(file->sf_file); + err = fsync(fd); writecount = 0; } #endif @@ -1602,6 +1605,7 @@ skygw_file_t* skygw_file_init( { skygw_file_t* file; + file = (skygw_file_t *)calloc(1, sizeof(skygw_file_t)); if (file == NULL) { @@ -1612,8 +1616,10 @@ skygw_file_t* skygw_file_init( file->sf_chk_top = CHK_NUM_FILE; file->sf_chk_tail = CHK_NUM_FILE; file->sf_fname = strdup(fname); - file->sf_file = fopen(file->sf_fname, "a"); + file->sf_file = fopen(file->sf_fname, "a"); + setvbuf(file->sf_file, NULL, _IONBF, 0); + if (file->sf_file == NULL) { fprintf(stderr, "Opening file %s failed.\n", file->sf_fname); perror("SkyGW file open\n");