Re: pgwin32_open returning EINVAL

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgwin32_open returning EINVAL
Date: 2007-11-29 12:09:47
Message-ID: 20071129120947.GD4858@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Magnus Hagander wrote:
> On Wed, Nov 28, 2007 at 05:20:46PM +0100, Magnus Hagander wrote:
> > On Wed, Nov 28, 2007 at 12:24:26PM -0300, Alvaro Herrera wrote:
> > > Martijn van Oosterhout wrote:
> > > > On Wed, Nov 28, 2007 at 11:57:35AM -0300, Alvaro Herrera wrote:
> > > > > Can we do something like this to report the Win32 error code so that the
> > > > > user has a higher chance of figuring out what's going on?
> >
> > We already do something very similar to what you're donig in
> > backend/port/wni32/socket.c :: TranslateSocketError().
> >
> > So I think it's a good idea to do it, yes.
>
> Thinking about this some more, I think this is a better patch - we already
> have a function that takes care of this, including both error and debug
> logging. Anybody disagree? If not, I'll go ahead and apply it...

Hmm, but this still mixes some error codes. To absolutely get the
Windows error code you would have to be running with DEBUG5, which I
don't think is acceptable for a production system during any interesting
length of time ... Can we have that DEBUG5 message changed to LOG
instead?

Or maybe have _dosmaperr receive the elevel with which to report the
message as a parameter, and have current callers use DEBUG5, and
pgwin32_open use LOG. That way we can backpatch it to 8.2 without
changing current behavior.

--
Alvaro Herrera Valdivia, Chile ICBM: S 39º 49' 18.1", W 73º 13' 56.4"
"Prefiero omelette con amigos que caviar con tontos"
(Alain Nonnet)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message hubert depesz lubaczewski 2007-11-29 12:17:04 Re: [HACKERS] [GENERAL] plperl and regexps with accented characters - incompatible?
Previous Message Magnus Hagander 2007-11-29 11:48:43 Re: pgwin32_open returning EINVAL