summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian2005-05-11 17:57:56 +0000
committerBruce Momjian2005-05-11 17:57:56 +0000
commitbe1cc6955c80b790dc1054239ce0d92bf1ca8108 (patch)
tree94006f5cef38e666b73265bf3cf73594c80eaa24
parent7b3bf6027780f1d8cd57f0ddf2b96e44395c136e (diff)
Fix pg_autovacuum -s flag to handle values > 2000 by using sleep()
instead of pg_usleep. Backpatch to 8.0.X.
-rw-r--r--contrib/pg_autovacuum/pg_autovacuum.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/contrib/pg_autovacuum/pg_autovacuum.c b/contrib/pg_autovacuum/pg_autovacuum.c
index 2388b3f351a..d9cafa523dc 100644
--- a/contrib/pg_autovacuum/pg_autovacuum.c
+++ b/contrib/pg_autovacuum/pg_autovacuum.c
@@ -4,7 +4,7 @@
* Revisions by Christopher B. Browne, Liberty RMS
* Win32 Service code added by Dave Page
*
- * $PostgreSQL: pgsql/contrib/pg_autovacuum/pg_autovacuum.c,v 1.32 2005/05/11 14:53:43 momjian Exp $
+ * $PostgreSQL: pgsql/contrib/pg_autovacuum/pg_autovacuum.c,v 1.33 2005/05/11 17:57:56 momjian Exp $
*/
#include "postgres_fe.h"
@@ -1749,7 +1749,16 @@ VacuumLoop(int argc, char **argv)
fflush(LOGOUTPUT);
}
- pg_usleep(sleep_secs * 1000000L); /* Larger Pause between outer loops */
+ /* Larger Pause between outer loops */
+ /*
+ * pg_usleep() is wrong here because its maximum is ~2000 seconds,
+ * and we don't need signal interruptability on Win32 here.
+ */
+#ifndef WIN32
+ sleep(sleep_secs); /* Unix sleep is seconds */
+#else
+ sleep(sleep_secs * 1000); /* Win32 sleep() is milliseconds */
+#endif
gettimeofday(&then, 0); /* Reset time counter */