Printf format checking added to logging function.

Printf format checking added to logging function and all
issues that were revealed by that fixed.
This commit is contained in:
Johan Wikman
2015-11-16 11:38:03 +02:00
parent 44df53d846
commit a355e1beef
26 changed files with 209 additions and 191 deletions

View File

@ -153,7 +153,7 @@ char* config_clean_string_list(char* str)
PCRE2_UCHAR errbuf[STRERROR_BUFLEN];
pcre2_get_error_message(re_err, errbuf, sizeof(errbuf));
MXS_ERROR("[%s] Regular expression compilation failed at %d: %s",
__FUNCTION__, err_offset, errbuf);
__FUNCTION__, (int)err_offset, errbuf);
pcre2_code_free(re);
free(dest);
return NULL;

View File

@ -1014,7 +1014,7 @@ int dcb_read_SSL(DCB *dcb,
if (buffer)
{
#ifdef SS_DEBUG
MXS_DEBUG("%lu SSL: Truncated buffer from %d to %d bytes. "
MXS_DEBUG("%lu SSL: Truncated buffer from %d to %ld bytes. "
"Read %d bytes, %d bytes waiting.\n", pthread_self(),
bufsize, GWBUF_LENGTH(buffer), n, b);
@ -1204,10 +1204,8 @@ dcb_write_parameter_check(DCB *dcb, GWBUF *queue)
MXS_DEBUG("%lu [dcb_write] Write aborted to dcb %p because "
"it is in state %s",
pthread_self(),
dcb->stats.n_buffered,
dcb,
STRDCBSTATE(dcb->state),
dcb->fd);
STRDCBSTATE(dcb->state));
gwbuf_free(queue);
return false;
}
@ -1640,12 +1638,7 @@ dcb_drain_writeq_SSL(DCB *dcb)
{
break;
}
MXS_ERROR("Write to dcb failed due to "
"SSL error %d:",
dcb,
STRDCBSTATE(dcb->state),
dcb->fd,
ssl_errno);
MXS_ERROR("Write to dcb failed due to SSL error %d:", ssl_errno);
switch(ssl_errno)
{
case SSL_ERROR_SSL:
@ -1833,7 +1826,7 @@ dcb_maybe_add_persistent(DCB *dcb)
else
{
MXS_DEBUG("%lu [dcb_maybe_add_persistent] Not adding DCB %p to persistent pool, "
"user %s, max for pool %d, error handle called %s, hung flag %s, "
"user %s, max for pool %ld, error handle called %s, hung flag %s, "
"server status %d, pool count %d.\n",
pthread_self(),
dcb,

View File

@ -166,7 +166,7 @@ int externcmd_execute(EXTERNCMD* cmd)
{
cmd->child = pid;
cmd->n_exec++;
MXS_DEBUG("[monitor_exec_cmd] Forked child process %d : %s.", pid, cmd);
MXS_DEBUG("[monitor_exec_cmd] Forked child process %d : %s.", pid, cmd->argv[0]);
}
return rval;

View File

@ -808,7 +808,7 @@ do_http_post(GWBUF *buffer, void *cfg) {
goto cleanup;
}
MXS_INFO("do_http_post() ret_code [%d], HTTP code [%d]",
MXS_INFO("do_http_post() ret_code [%d], HTTP code [%ld]",
ret_code, http_code);
cleanup:

View File

@ -177,7 +177,7 @@ secrets_readKeys(const char* path)
"%s failed. Read %d, expected %d bytes. Error %d, %s.",
secret_file,
len,
sizeof(MAXKEYS),
(int)sizeof(MAXKEYS),
eno,
strerror_r(eno, errbuf, sizeof(errbuf)));
return NULL;