Unix Technical Forum

Re: Bad bug in fopen() wrapper code

This is a discussion on Re: Bad bug in fopen() wrapper code within the Pgsql Patches forums, part of the PostgreSQL category; --> "Magnus Hagander" <mha@sollentuna.net> writes: > Attached patch sets the O_CREAT option when appending to files. That looks correct, but ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Patches

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-18-2008, 10:02 AM
Tom Lane
 
Posts: n/a
Default Re: Bad bug in fopen() wrapper code

"Magnus Hagander" <mha@sollentuna.net> writes:
> Attached patch sets the O_CREAT option when appending to files.


That looks correct, but I went looking to see if there were any other
mistakes of the same ilk, and I'm wondering what the sense is in
openFlagsToCreateFileFlags ... seems like it's ignoring O_EXCL in
some combinations and not others. Is that right?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 10:02 AM
Magnus Hagander
 
Posts: n/a
Default Re: Bad bug in fopen() wrapper code

> > Attached patch sets the O_CREAT option when appending to files.
>
> That looks correct, but I went looking to see if there were
> any other mistakes of the same ilk, and I'm wondering what
> the sense is in openFlagsToCreateFileFlags ... seems like
> it's ignoring O_EXCL in some combinations and not others. Is
> that right?


That is part of the original open() code that Claudio did back for 8.0,
so it has definitly been working since then. 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?

//Magnus

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-18-2008, 10:02 AM
Tom Lane
 
Posts: n/a
Default Re: Bad bug in fopen() wrapper code

"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

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:26 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com