Skip to content

Commit 75bb2b6

Browse files
committed
Assume select() might modify struct timeout, so remove previous
optimization.
1 parent 447450d commit 75bb2b6

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/backend/postmaster/pgstat.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
* Copyright (c) 2001-2005, PostgreSQL Global Development Group
1515
*
16-
* $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.117 2006/01/03 16:42:17 momjian Exp $
16+
* $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.118 2006/01/03 19:54:08 momjian Exp $
1717
* ----------
1818
*/
1919
#include "postgres.h"
@@ -1870,14 +1870,6 @@ pgstat_recvbuffer(void)
18701870
*/
18711871
msgbuffer = (char *) palloc(PGSTAT_RECVBUFFERSZ);
18721872

1873-
/*
1874-
* Wait for some work to do; but not for more than 10 seconds. (This
1875-
* determines how quickly we will shut down after an ungraceful
1876-
* postmaster termination; so it needn't be very fast.)
1877-
*/
1878-
timeout.tv_sec = 10;
1879-
timeout.tv_usec = 0;
1880-
18811873
/*
18821874
* Loop forever
18831875
*/
@@ -1918,6 +1910,15 @@ pgstat_recvbuffer(void)
19181910
maxfd = writePipe;
19191911
}
19201912

1913+
/*
1914+
* Wait for some work to do; but not for more than 10 seconds. (This
1915+
* determines how quickly we will shut down after an ungraceful
1916+
* postmaster termination; so it needn't be very fast.) struct timeout
1917+
* is modified by some operating systems.
1918+
*/
1919+
timeout.tv_sec = 10;
1920+
timeout.tv_usec = 0;
1921+
19211922
if (select(maxfd + 1, &rfds, &wfds, NULL, &timeout) < 0)
19221923
{
19231924
if (errno == EINTR)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy