30
30
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
31
31
* Portions Copyright (c) 1994, Regents of the University of California
32
32
*
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 $
34
34
*
35
35
*-------------------------------------------------------------------------
36
36
*/
83
83
#ifdef HAVE_UTIME_H
84
84
#include <utime.h>
85
85
#endif
86
- #ifdef WIN32
86
+ #ifdef WIN32_ONLY_COMPILER /* mstcpip.h is missing on mingw */
87
87
#include <mstcpip.h>
88
88
#endif
89
89
@@ -1323,7 +1323,7 @@ pq_endcopyout(bool errorAbort)
1323
1323
* actually set them to zero, not default), therefor we fallback to
1324
1324
* the out-of-the-box default instead.
1325
1325
*/
1326
- #ifdef WIN32
1326
+ #if defined( WIN32 ) && defined( SIO_KEEPALIVE_VALS )
1327
1327
static int
1328
1328
pq_setkeepaliveswin32 (Port * port , int idle , int interval )
1329
1329
{
@@ -1412,7 +1412,7 @@ pq_setkeepalivesidle(int idle, Port *port)
1412
1412
if (port == NULL || IS_AF_UNIX (port -> laddr .addr .ss_family ))
1413
1413
return STATUS_OK ;
1414
1414
1415
- #if defined(TCP_KEEPIDLE ) || defined(TCP_KEEPALIVE ) || defined(WIN32 )
1415
+ #if defined(TCP_KEEPIDLE ) || defined(TCP_KEEPALIVE ) || defined(SIO_KEEPALIVE_VALS )
1416
1416
if (idle == port -> keepalives_idle )
1417
1417
return STATUS_OK ;
1418
1418
@@ -1451,7 +1451,7 @@ pq_setkeepalivesidle(int idle, Port *port)
1451
1451
#else /* WIN32 */
1452
1452
return pq_setkeepaliveswin32 (port , idle , port -> keepalives_interval );
1453
1453
#endif
1454
- #else /* TCP_KEEPIDLE || WIN32 */
1454
+ #else /* TCP_KEEPIDLE || SIO_KEEPALIVE_VALS */
1455
1455
if (idle != 0 )
1456
1456
{
1457
1457
elog (LOG , "setting the keepalive idle time is not supported" );
@@ -1464,7 +1464,7 @@ pq_setkeepalivesidle(int idle, Port *port)
1464
1464
int
1465
1465
pq_getkeepalivesinterval (Port * port )
1466
1466
{
1467
- #if defined(TCP_KEEPINTVL ) || defined(WIN32 )
1467
+ #if defined(TCP_KEEPINTVL ) || defined(SIO_KEEPALIVE_VALS )
1468
1468
if (port == NULL || IS_AF_UNIX (port -> laddr .addr .ss_family ))
1469
1469
return 0 ;
1470
1470
@@ -1501,7 +1501,7 @@ pq_setkeepalivesinterval(int interval, Port *port)
1501
1501
if (port == NULL || IS_AF_UNIX (port -> laddr .addr .ss_family ))
1502
1502
return STATUS_OK ;
1503
1503
1504
- #if defined(TCP_KEEPINTVL ) || defined (WIN32 )
1504
+ #if defined(TCP_KEEPINTVL ) || defined (SIO_KEEPALIVE_VALS )
1505
1505
if (interval == port -> keepalives_interval )
1506
1506
return STATUS_OK ;
1507
1507
0 commit comments