summaryrefslogtreecommitdiff
path: root/src/bin/pg_ctl/pg_ctl.c
diff options
context:
space:
mode:
authorMagnus Hagander <magnus@hagander.net>2011-06-09 18:18:45 +0200
committerMagnus Hagander <magnus@hagander.net>2011-06-09 18:28:04 +0200
commit9c04b889966a24c2c021039ba29b30bc7592994c (patch)
tree4950789a09c816c83a6838c34aec645962e9b8a6 /src/bin/pg_ctl/pg_ctl.c
parent302e4e6f3b5f5e03162f11c8a074d337cd11acf7 (diff)
Support silent mode for service registrations on win32
Using -s when registering a service will now suppress the application eventlog entries stating that the service is starting and started. MauMau
Diffstat (limited to 'src/bin/pg_ctl/pg_ctl.c')
-rw-r--r--src/bin/pg_ctl/pg_ctl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c
index 92fc1f28302..448bb77be49 100644
--- a/src/bin/pg_ctl/pg_ctl.c
+++ b/src/bin/pg_ctl/pg_ctl.c
@@ -159,6 +159,9 @@ write_eventlog(int level, const char *line)
{
static HANDLE evtHandle = INVALID_HANDLE_VALUE;
+ if (silent_mode && level == EVENTLOG_INFORMATION_TYPE)
+ return;
+
if (evtHandle == INVALID_HANDLE_VALUE)
{
evtHandle = RegisterEventSource(NULL, "PostgreSQL");
@@ -1065,6 +1068,9 @@ pgwin32_CommandLine(bool registration)
/* concatenate */
sprintf(cmdLine + strlen(cmdLine), " -t %d", wait_seconds);
+ if (registration && silent_mode)
+ strcat(cmdLine, " -s");
+
if (post_opts)
{
strcat(cmdLine, " ");