Re: BUG #13594: pg_ctl.exe redirects stderr to Windows Events Log if stderr is redirected to pipe

From: Andres Freund <andres(at)anarazel(dot)de>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: ekocjan(at)gmail(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13594: pg_ctl.exe redirects stderr to Windows Events Log if stderr is redirected to pipe
Date: 2015-09-03 11:36:11
Message-ID: 20150903113611.GD27649@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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?

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Sjon Hortensius 2015-09-03 12:00:08 INSERT INTO .. SELECT nextval() ORDER BY - returns unexpectedly ordered values
Previous Message Bruce Momjian 2015-09-03 11:02:35 Re: BUG #13440: unaccent does not remove all diacritics