Skip to content

Commit 09a98e6

Browse files
committed
Fix pg_ctl -t to register -t value, per Alvaro.
1 parent 9eced00 commit 09a98e6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/bin/pg_ctl/pg_ctl.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.89 2007/11/15 21:14:41 momjian Exp $
7+
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.90 2007/11/20 19:24:26 momjian Exp $
88
*
99
*-------------------------------------------------------------------------
1010
*/
@@ -77,10 +77,11 @@ typedef enum
7777
RUN_AS_SERVICE_COMMAND
7878
} CtlCommand;
7979

80+
#define DEFAULT_WAIT 60
8081

8182
static bool do_wait = false;
8283
static bool wait_set = false;
83-
static int wait_seconds = 60;
84+
static int wait_seconds = DEFAULT_WAIT;
8485
static bool silent_mode = false;
8586
static ShutdownMode shutdown_mode = SMART_MODE;
8687
static int sig = SIGTERM; /* default */
@@ -1031,6 +1032,10 @@ pgwin32_CommandLine(bool registration)
10311032
if (registration && do_wait)
10321033
strcat(cmdLine, " -w");
10331034

1035+
if (registration && wait_seconds != DEFAULT_WAIT)
1036+
/* concatenate */
1037+
sprintf(cmdLine + strlen(cmdLine), " -t %d", wait_seconds);
1038+
10341039
if (post_opts)
10351040
{
10361041
strcat(cmdLine, " ");
@@ -1472,7 +1477,8 @@ do_help(void)
14721477
printf(_("Usage:\n"));
14731478
printf(_(" %s start [-w] [-t SECS] [-D DATADIR] [-s] [-l FILENAME] [-o \"OPTIONS\"]\n"), progname);
14741479
printf(_(" %s stop [-W] [-t SECS] [-D DATADIR] [-s] [-m SHUTDOWN-MODE]\n"), progname);
1475-
printf(_(" %s restart [-w] [-t SECS] [-D DATADIR] [-s] [-m SHUTDOWN-MODE]\n [-o \"OPTIONS\"]\n"), progname);
1480+
printf(_(" %s restart [-w] [-t SECS] [-D DATADIR] [-s] [-m SHUTDOWN-MODE]\n"
1481+
" [-o \"OPTIONS\"]\n"), progname);
14761482
printf(_(" %s reload [-D DATADIR] [-s]\n"), progname);
14771483
printf(_(" %s status [-D DATADIR]\n"), progname);
14781484
printf(_(" %s kill SIGNALNAME PID\n"), progname);

0 commit comments

Comments
 (0)