diff options
| author | Magnus Hagander <magnus@hagander.net> | 2011-06-09 18:18:45 +0200 |
|---|---|---|
| committer | Magnus Hagander <magnus@hagander.net> | 2011-06-09 18:26:25 +0200 |
| commit | 15fe829b23ad1871ed0b27d807371cbd37768289 (patch) | |
| tree | d8c0642ba75f796de18b10d423bc30ef53e207a1 /src/bin/pg_ctl/pg_ctl.c | |
| parent | ffa653b945cb6a03e64b7c7c0d61b7ee916ada1b (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.c | 6 |
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 dad7e8b79df..7714815b058 100644 --- a/src/bin/pg_ctl/pg_ctl.c +++ b/src/bin/pg_ctl/pg_ctl.c @@ -155,6 +155,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"); @@ -1131,6 +1134,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, " "); |
