Put errors ganerating code behind FAKE_CODE macro, which is not defined by default in any build.

This commit is contained in:
VilhoRaatikka
2014-11-10 15:22:08 +02:00
parent 7f7cb0a982
commit 9a5168c3e8
6 changed files with 22 additions and 25 deletions

View File

@ -862,7 +862,7 @@ int below_water;
while (queue != NULL)
{
int qlen;
#if defined(SS_DEBUG)
#if defined(FAKE_CODE)
if (dcb->dcb_role == DCB_ROLE_REQUEST_HANDLER &&
dcb->session != NULL)
{
@ -878,7 +878,7 @@ int below_water;
fail_next_backend_fd = false;
}
}
#endif /* SS_DEBUG */
#endif /* FAKE_CODE */
qlen = GWBUF_LENGTH(queue);
GW_NOINTR_CALL(
w = gw_write(
@ -1684,7 +1684,7 @@ int gw_write(
size_t nbytes)
{
int w;
#if defined(SS_DEBUG)
#if defined(FAKE_CODE)
if (dcb_fake_write_errno[fd] != 0) {
ss_dassert(dcb_fake_write_ev[fd] != 0);
w = write(fd, buf, nbytes/2); /*< leave peer to read missing bytes */
@ -1698,7 +1698,7 @@ int gw_write(
}
#else
w = write(fd, buf, nbytes);
#endif /* SS_DEBUG && SS_TEST */
#endif /* FAKE_CODE */
#if defined(SS_DEBUG_MYSQL)
{

View File

@ -1025,7 +1025,7 @@ int main(int argc, char **argv)
progname = *argv;
#if defined(SS_DEBUG)
#if defined(FAKE_CODE)
memset(conn_open, 0, sizeof(bool)*10240);
memset(dcb_fake_write_errno, 0, sizeof(unsigned char)*10240);
memset(dcb_fake_write_ev, 0, sizeof(__int32_t)*10240);
@ -1033,7 +1033,7 @@ int main(int argc, char **argv)
fail_next_client_fd = false;
fail_next_accept = 0;
fail_accept_errno = 0;
#endif
#endif /* FAKE_CODE */
file_write_header(stderr);
/*<
* Register functions which are called at exit except libmysqld-related,

View File

@ -625,7 +625,7 @@ uint32_t ev;
thread_data[thread_id].event = ev;
}
#if defined(SS_DEBUG)
#if defined(FAKE_CODE)
if (dcb_fake_write_ev[dcb->fd] != 0) {
LOGIF(LD, (skygw_log_write(
LOGFILE_DEBUG,
@ -637,7 +637,7 @@ uint32_t ev;
ev |= dcb_fake_write_ev[dcb->fd];
dcb_fake_write_ev[dcb->fd] = 0;
}
#endif
#endif /* FAKE_CODE */
ss_debug(spinlock_acquire(&dcb->dcb_initlock);)
ss_dassert(dcb->state != DCB_STATE_ALLOC);
ss_dassert(dcb->state != DCB_STATE_DISCONNECTED);
@ -735,7 +735,7 @@ uint32_t ev;
if (ev & EPOLLERR)
{
int eno = gw_getsockerrno(dcb->fd);
#if defined(SS_DEBUG)
#if defined(FAKE_CODE)
if (eno == 0) {
eno = dcb_fake_write_errno[dcb->fd];
LOGIF(LD, (skygw_log_write(
@ -748,7 +748,7 @@ uint32_t ev;
strerror(eno))));
}
dcb_fake_write_errno[dcb->fd] = 0;
#endif
#endif /* FAKE_CODE */
if (eno != 0) {
LOGIF(LD, (skygw_log_write(
LOGFILE_DEBUG,