This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gfortran] patch for PR 16196, error on OPEN(...STATUS='REPLACE')


On Fri, Jun 25, 2004 at 04:02:32PM -0500, Bud Davis wrote:
> !       if (stat (path, &statbuf) < 0)
> !         mode |= O_CREAT | O_EXCL;
> !       else
> !         mode |= O_TRUNC;

Why bother stat?  Just add O_CREAT all the time.

There's no point to O_EXCL; you're just introducing a race condition.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]