aboutsummaryrefslogtreecommitdiff
path: root/src
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:27:08 +0200
commit63784d792b6ac9711b222687884f3a52e1f6b36f (patch)
treedc94e038ce0c9c61fa01c172666735724c008925 /src
parent066d5a3ef5409da833c1138de640d26ec011277c (diff)
downloadpostgresql-63784d792b6ac9711b222687884f3a52e1f6b36f.tar.gz
postgresql-63784d792b6ac9711b222687884f3a52e1f6b36f.zip
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')
-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 e80031fba97..aa5fe727cc5 100644
--- a/src/bin/pg_ctl/pg_ctl.c
+++ b/src/bin/pg_ctl/pg_ctl.c
@@ -152,6 +152,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");
@@ -1059,6 +1062,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, " ");