Re: Bad bug in fopen() wrapper code - Mailing list pgsql-patches

From Tom Lane
Subject Re: Bad bug in fopen() wrapper code
Date
Msg-id 8015.1159118168@sss.pgh.pa.us
Whole thread Raw
In response to Re: Bad bug in fopen() wrapper code  ("Magnus Hagander" <mha@sollentuna.net>)
List pgsql-patches
"Magnus Hagander" <mha@sollentuna.net> writes:
> That is part of the original open() code that Claudio did back for 8.0,
> so it has definitly been working since then.

Hm, maybe best not to touch it, but still...

> I haven't really read into
> the code, though... But a qiuck look doesn't show me any place wher eit
> does ignore O_EXCL - which combination would that be?

What's bugging me is that 0 and O_EXCL give the same answer, and
O_TRUNC and O_TRUNC | O_EXCL give the same answer, but O_CREAT and
O_CREAT | O_EXCL give different answers, as do O_CREAT | O_TRUNC
and O_CREAT | O_TRUNC | O_EXCL.  I'm also pretty suspicious of
both O_CREAT | O_EXCL and O_CREAT | O_TRUNC | O_EXCL giving the
same answer.  However, I have no idea what the semantics are of
the symbols the function is mapping into, so maybe it's OK.

            regards, tom lane

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Updates to pg_regress.c
Next
From: Tom Lane
Date:
Subject: Re: Bad bug in fopen() wrapper code