Re: pgwin32_safestat weirdness - Mailing list pgsql-hackers

From Magnus Hagander
Subject Re: pgwin32_safestat weirdness
Date
Msg-id 20080415095621.2d562e29@mha-laptop
Whole thread Raw
In response to Re: pgwin32_safestat weirdness  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pgwin32_safestat weirdness
List pgsql-hackers
Tom Lane wrote:
> Magnus Hagander <magnus@hagander.net> writes:
> > Is there not a (3) which has it included in all frontend code
> > *except* libpq? Do we have a define to do that off?
> 
> Offhand I can't think of one.
> 
> > In libpq, it's only used in one place to check if a file is present,
> > and one then in the SSL code to determine permissions and such
> > (which means it's being ignored on win32). 
> 
> Maybe we could finess the problem by tweaking libpq to not use stat()
> at all on Windows.

Seems that for the use in fe-connect.c, we could just use open()
instead of stat() if we care.

In fe-secure.c we'd have to have a bit more code since we'd use open()
or so on Win32 to test it, and stat() on unix (because on Unix we need
the output from stat).

Shouldn't be too hard to do, but I keep thinking it'd be cleaner to
just not do the redefine when building libpq. It means we'd add a
define like BUILDING_LIBPQ or something to the libpq Makefile, and
exclude the redefine if set. 

I can go with either way, though ;-)

//Magnus


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: pgwin32_safestat weirdness
Next
From: Florian Weimer
Date:
Subject: Re: Cached Query Plans