Fix to unreported bug which printed result of getsockopt even in case when there was no socket error.

This commit is contained in:
VilhoRaatikka
2014-11-27 15:37:13 +02:00
parent d063df0f4a
commit 83f7203213
2 changed files with 23 additions and 21 deletions

View File

@ -1244,7 +1244,6 @@ bool service_set_param_value (
* 0 error * 0 error
* > 0 position in TYPELIB->type_names +1 * > 0 position in TYPELIB->type_names +1
*/ */
static int find_type( static int find_type(
typelib_t* tl, typelib_t* tl,
const char* needle, const char* needle,

View File

@ -1070,6 +1070,8 @@ gw_backend_hangup(DCB *dcb)
len = sizeof(error); len = sizeof(error);
if (getsockopt(dcb->fd, SOL_SOCKET, SO_ERROR, &error, &len) == 0) if (getsockopt(dcb->fd, SOL_SOCKET, SO_ERROR, &error, &len) == 0)
{
if (error != 0)
{ {
strerror_r(error, buf, 100); strerror_r(error, buf, 100);
LOGIF(LE, (skygw_log_write_flush( LOGIF(LE, (skygw_log_write_flush(
@ -1078,6 +1080,7 @@ gw_backend_hangup(DCB *dcb)
"Error reported is '%s'.", "Error reported is '%s'.",
buf))); buf)));
} }
}
gwbuf_free(errbuf); gwbuf_free(errbuf);
goto retblock; goto retblock;
} }