postgres.git / summary / log / commit / refs
commit 75bb2b611db9d008796889263f6d09863fe81bdf
Author: Bruce Momjian <bruce@momjian.us>
Date: Tue Jan 03 19:54:08 2006 +0000
First released in: 8.2.0
Assume select() might modify struct timeout, so remove previous
optimization.
src/backend/postmaster/pgstat.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index ef27046e95c..a192b4e5c87 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -13,7 +13,7 @@
*
* Copyright (c) 2001-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.117 2006/01/03 16:42:17 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.118 2006/01/03 19:54:08 momjian Exp $
* ----------
*/
#include "postgres.h"
@@ -1870,14 +1870,6 @@ pgstat_recvbuffer(void)
*/
msgbuffer = (char *) palloc(PGSTAT_RECVBUFFERSZ);
- /*
- * Wait for some work to do; but not for more than 10 seconds. (This
- * determines how quickly we will shut down after an ungraceful
- * postmaster termination; so it needn't be very fast.)
- */
- timeout.tv_sec = 10;
- timeout.tv_usec = 0;
-
/*
* Loop forever
*/
@@ -1918,6 +1910,15 @@ pgstat_recvbuffer(void)
maxfd = writePipe;
}
+ /*
+ * Wait for some work to do; but not for more than 10 seconds. (This
+ * determines how quickly we will shut down after an ungraceful
+ * postmaster termination; so it needn't be very fast.) struct timeout
+ * is modified by some operating systems.
+ */
+ timeout.tv_sec = 10;
+ timeout.tv_usec = 0;
+
if (select(maxfd + 1, &rfds, &wfds, NULL, &timeout) < 0)
{
if (errno == EINTR)
[parent: 447450df7160]