File tree 1 file changed +14
-3
lines changed
1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 13
13
*
14
14
* Copyright (c) 2001-2003, PostgreSQL Global Development Group
15
15
*
16
- * $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.60 2004/03/10 21:12:46 momjian Exp $
16
+ * $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.61 2004/03/15 16: 21:37 momjian Exp $
17
17
* ----------
18
18
*/
19
19
#include "postgres.h"
@@ -1642,6 +1642,7 @@ pgstat_mainChild(PGSTAT_FORK_ARGS)
1642
1642
*/
1643
1643
int nread = 0 ;
1644
1644
int targetlen = sizeof (PgStat_MsgHdr ); /* initial */
1645
+ bool pipeEOF = false;
1645
1646
1646
1647
while (nread < targetlen )
1647
1648
{
@@ -1652,13 +1653,23 @@ pgstat_mainChild(PGSTAT_FORK_ARGS)
1652
1653
{
1653
1654
if (errno == EINTR )
1654
1655
continue ;
1656
+ #ifdef WIN32
1657
+ if (WSAGetLastError () == WSAECONNRESET ) /* EOF on the pipe! (win32 socket based implementation) */
1658
+ {
1659
+ pipeEOF = true;
1660
+ break ;
1661
+ }
1662
+ #endif
1655
1663
ereport (LOG ,
1656
1664
(errcode_for_socket_access (),
1657
- errmsg ("could not read from statistics collector pipe: %m" )));
1665
+ errmsg ("could not read from statistics collector pipe: %m" )));
1658
1666
exit (1 );
1659
1667
}
1660
1668
if (len == 0 ) /* EOF on the pipe! */
1669
+ {
1670
+ pipeEOF = true;
1661
1671
break ;
1672
+ }
1662
1673
nread += len ;
1663
1674
if (nread == sizeof (PgStat_MsgHdr ))
1664
1675
{
@@ -1683,7 +1694,7 @@ pgstat_mainChild(PGSTAT_FORK_ARGS)
1683
1694
* EOF on the pipe implies that the buffer process exited.
1684
1695
* Fall out of outer loop.
1685
1696
*/
1686
- if (len == 0 )
1697
+ if (pipeEOF )
1687
1698
break ;
1688
1699
1689
1700
/*
You can’t perform that action at this time.
0 commit comments