Fix to bug #558, http://bugs.mariadb.com/show_bug.cgi?id=558
Added #include <strings.h> and length indicator to strncasecmp call. Fix to bug #513, http://bugs.mariadb.com/show_bug.cgi?id=513 Replaced usleep with nanosleep.
This commit is contained in:
@ -42,8 +42,10 @@
|
|||||||
#define _XOPEN_SOURCE 700
|
#define _XOPEN_SOURCE 700
|
||||||
#include <ftw.h>
|
#include <ftw.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <strings.h>
|
||||||
#include <gw.h>
|
#include <gw.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <time.h>
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <service.h>
|
#include <service.h>
|
||||||
#include <server.h>
|
#include <server.h>
|
||||||
@ -226,7 +228,6 @@ sigfatal_handler (int i)
|
|||||||
|
|
||||||
{
|
{
|
||||||
void *addrs[128];
|
void *addrs[128];
|
||||||
char **strings= NULL;
|
|
||||||
int n, count = backtrace(addrs, 128);
|
int n, count = backtrace(addrs, 128);
|
||||||
char** symbols = backtrace_symbols( addrs, count );
|
char** symbols = backtrace_symbols( addrs, count );
|
||||||
|
|
||||||
@ -1088,9 +1089,9 @@ int main(int argc, char **argv)
|
|||||||
goto return_main;
|
goto return_main;
|
||||||
|
|
||||||
case 'l':
|
case 'l':
|
||||||
if (strncasecmp(optarg, "file") == 0)
|
if (strncasecmp(optarg, "file", PATH_MAX) == 0)
|
||||||
logtofile = 1;
|
logtofile = 1;
|
||||||
else if (strncasecmp(optarg, "shm") == 0)
|
else if (strncasecmp(optarg, "shm", PATH_MAX) == 0)
|
||||||
logtofile = 0;
|
logtofile = 0;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1669,6 +1670,8 @@ static void log_flush_cb(
|
|||||||
void* arg)
|
void* arg)
|
||||||
{
|
{
|
||||||
ssize_t timeout_ms = *(ssize_t *)arg;
|
ssize_t timeout_ms = *(ssize_t *)arg;
|
||||||
|
const struct timespec ts1 = {0, 1000000*timeout_ms};
|
||||||
|
struct timespec ts2;
|
||||||
|
|
||||||
LOGIF(LM, (skygw_log_write(LOGFILE_MESSAGE,
|
LOGIF(LM, (skygw_log_write(LOGFILE_MESSAGE,
|
||||||
"Started MaxScale log flusher.")));
|
"Started MaxScale log flusher.")));
|
||||||
@ -1677,7 +1680,7 @@ static void log_flush_cb(
|
|||||||
skygw_log_flush(LOGFILE_MESSAGE);
|
skygw_log_flush(LOGFILE_MESSAGE);
|
||||||
skygw_log_flush(LOGFILE_TRACE);
|
skygw_log_flush(LOGFILE_TRACE);
|
||||||
skygw_log_flush(LOGFILE_DEBUG);
|
skygw_log_flush(LOGFILE_DEBUG);
|
||||||
usleep(timeout_ms*1000);
|
nanosleep(&ts1, &ts2);
|
||||||
}
|
}
|
||||||
LOGIF(LM, (skygw_log_write(LOGFILE_MESSAGE,
|
LOGIF(LM, (skygw_log_write(LOGFILE_MESSAGE,
|
||||||
"Finished MaxScale log flusher.")));
|
"Finished MaxScale log flusher.")));
|
||||||
|
Reference in New Issue
Block a user