Re: BUG #13594: pg_ctl.exe redirects stderr to Windows Events Log if stderr is redirected to pipe - Mailing list pgsql-bugs

From Michael Paquier
Subject Re: BUG #13594: pg_ctl.exe redirects stderr to Windows Events Log if stderr is redirected to pipe
Date
Msg-id CAB7nPqQp0+d0xQ36tSrmYf0av3OvDYki78MZuKE9RUSiF7YSFA@mail.gmail.com
Whole thread Raw
In response to Re: BUG #13594: pg_ctl.exe redirects stderr to Windows Events Log if stderr is redirected to pipe  (Andres Freund <andres@anarazel.de>)
Responses Re: BUG #13594: pg_ctl.exe redirects stderr to Windows Events Log if stderr is redirected to pipe  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-bugs
On Thu, Sep 3, 2015 at 8:36 PM, Andres Freund <andres@anarazel.de> wrote:
> On 2015-08-31 15:51:57 +0900, Michael Paquier wrote:
>>       if (!OpenProcessToken(GetCurrentProcess(), TOKEN_READ, &AccessToken))
>>       {
>> +#ifndef FRONTEND
>>               write_stderr("could not open process token: error code %lu\n",
>>                                        GetLastError());
>> +#else
>> +             fprintf(stderr, "could not open process token: error code %lu\n",
>> +                             GetLastError());
>> +#endif
>>               exit(1);
>>       }
>
> I find these kind of ifdefs rather ugly - why not just introduce a
> wrapper?

I thought it was just not worth it for this file. I don't mind
updating if you think that's cleaner this way.
--
Michael

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: INSERT INTO .. SELECT nextval() ORDER BY - returns unexpectedly ordered values
Next
From: Egon Kocjan
Date:
Subject: Re: BUG #13594: pg_ctl.exe redirects stderr to Windows Events Log if stderr is redirected to pipe