ecore-con: Do not use TCP_NODELAY if netinet/tcp.h is not found

SVN revision: 63679
This commit is contained in:
Youness Alaoui 2011-09-29 21:04:45 +00:00
parent 4b033861bb
commit ed03a201ef
1 changed files with 4 additions and 0 deletions

View File

@ -1394,10 +1394,12 @@ _ecore_con_cb_tcp_listen(void *data,
if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_NODELAY)
{
#ifdef HAVE_NETINET_TCP_H
int flag = 1;
if (setsockopt(svr->fd, IPPROTO_TCP, TCP_NODELAY, (char *)&flag,
sizeof(int)) < 0)
#endif
{
ecore_con_event_server_error(svr, strerror(errno));
goto error;
@ -1576,9 +1578,11 @@ _ecore_con_cb_tcp_connect(void *data,
if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_NODELAY)
{
#ifdef HAVE_NETINET_TCP_H
int flag = 1;
if (setsockopt(svr->fd, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, sizeof(int)) < 0)
#endif
{
ecore_con_event_server_error(svr, strerror(errno));
goto error;