Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Fix backwards test for Windows service-ness in pg_ctl.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 7 Mar 2016 15:40:44 +0000 (10:40 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 7 Mar 2016 15:41:01 +0000 (10:41 -0500)
A thinko in a96761391 caused pg_ctl to get it exactly backwards when
deciding whether to report problems to the Windows eventlog or to stderr.
Per bug #14001 from Manuel Mathar, who also identified the fix.
Like the previous patch, back-patch to all supported branches.

src/bin/pg_ctl/pg_ctl.c

index 4889e3a1a3ff0d10c6730f382edf91b12860f197..b4621220b91166b6a9a99d44b001acaeabbf1fdb 100644 (file)
@@ -221,7 +221,7 @@ write_stderr(const char *fmt,...)
     * On Win32, we print to stderr if running on a console, or write to
     * eventlog if running as a service
     */
-   if (!pgwin32_is_service())  /* Running as a service */
+   if (pgwin32_is_service())   /* Running as a service */
    {
        char        errbuf[2048];       /* Arbitrary size? */