3030 * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
3131 * Portions Copyright (c) 1994, Regents of the University of California
3232 *
33- * $PostgreSQL: pgsql/src/backend/libpq/pqcomm.c,v 1.211 2010/07/08 10:20:12 mha Exp $
33+ * $PostgreSQL: pgsql/src/backend/libpq/pqcomm.c,v 1.212 2010/07/08 16:19:50 mha Exp $
3434 *
3535 *-------------------------------------------------------------------------
3636 */
8383#ifdef HAVE_UTIME_H
8484#include <utime.h>
8585#endif
86- #ifdef WIN32
86+ #ifdef WIN32_ONLY_COMPILER /* mstcpip.h is missing on mingw */
8787#include <mstcpip.h>
8888#endif
8989
@@ -1323,7 +1323,7 @@ pq_endcopyout(bool errorAbort)
13231323 * actually set them to zero, not default), therefor we fallback to
13241324 * the out-of-the-box default instead.
13251325 */
1326- #ifdef WIN32
1326+ #if defined( WIN32 ) && defined( SIO_KEEPALIVE_VALS )
13271327static int
13281328pq_setkeepaliveswin32 (Port * port , int idle , int interval )
13291329{
@@ -1412,7 +1412,7 @@ pq_setkeepalivesidle(int idle, Port *port)
14121412 if (port == NULL || IS_AF_UNIX (port -> laddr .addr .ss_family ))
14131413 return STATUS_OK ;
14141414
1415- #if defined(TCP_KEEPIDLE ) || defined(TCP_KEEPALIVE ) || defined(WIN32 )
1415+ #if defined(TCP_KEEPIDLE ) || defined(TCP_KEEPALIVE ) || defined(SIO_KEEPALIVE_VALS )
14161416 if (idle == port -> keepalives_idle )
14171417 return STATUS_OK ;
14181418
@@ -1451,7 +1451,7 @@ pq_setkeepalivesidle(int idle, Port *port)
14511451#else /* WIN32 */
14521452 return pq_setkeepaliveswin32 (port , idle , port -> keepalives_interval );
14531453#endif
1454- #else /* TCP_KEEPIDLE || WIN32 */
1454+ #else /* TCP_KEEPIDLE || SIO_KEEPALIVE_VALS */
14551455 if (idle != 0 )
14561456 {
14571457 elog (LOG , "setting the keepalive idle time is not supported" );
@@ -1464,7 +1464,7 @@ pq_setkeepalivesidle(int idle, Port *port)
14641464int
14651465pq_getkeepalivesinterval (Port * port )
14661466{
1467- #if defined(TCP_KEEPINTVL ) || defined(WIN32 )
1467+ #if defined(TCP_KEEPINTVL ) || defined(SIO_KEEPALIVE_VALS )
14681468 if (port == NULL || IS_AF_UNIX (port -> laddr .addr .ss_family ))
14691469 return 0 ;
14701470
@@ -1501,7 +1501,7 @@ pq_setkeepalivesinterval(int interval, Port *port)
15011501 if (port == NULL || IS_AF_UNIX (port -> laddr .addr .ss_family ))
15021502 return STATUS_OK ;
15031503
1504- #if defined(TCP_KEEPINTVL ) || defined (WIN32 )
1504+ #if defined(TCP_KEEPINTVL ) || defined (SIO_KEEPALIVE_VALS )
15051505 if (interval == port -> keepalives_interval )
15061506 return STATUS_OK ;
15071507
0 commit comments