Re: pgwin32_safestat weirdness

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: pgwin32_safestat weirdness
Дата
Msg-id 20080415095621.2d562e29@mha-laptop
обсуждение исходный текст
Ответ на Re: pgwin32_safestat weirdness  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: pgwin32_safestat weirdness  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: pgwin32_safestat weirdness
Следующее
От: Florian Weimer
Дата:
Сообщение: Re: Cached Query Plans